Skip to content

fix(web): compact recent path labels - #1757

Open
techotaku39 wants to merge 2 commits into
tiann:mainfrom
techotaku39:investigate/recent-path-display
Open

fix(web): compact recent path labels#1757
techotaku39 wants to merge 2 commits into
tiann:mainfrom
techotaku39:investigate/recent-path-display

Conversation

@techotaku39

Copy link
Copy Markdown
Contributor

Summary

  • Show only the final two path segments for recent-directory buttons in the New Session form.
  • Preserve the full path in the button title and when selecting a recent path.
  • Reuse the same cross-platform formatter in the New Session form and session list.
  • Add POSIX and Windows path formatting plus click-preservation regression coverage.

Validation

  • bun run --cwd web test src/utils/path.test.ts src/components/NewSession/DirectorySection.test.tsx src/components/SessionList.test.ts — 55 tests passed.
  • bun typecheck — passed.
  • pwsh -NoProfile -File scripts/Invoke-HapiTaskPlaywright.ps1 -Name investigate-recent-path-display -Suite Root terminal-wrap-fidelity.spec.ts — 2 tests passed.
  • Manual smoke test on the Full test environment — the New Session page displayed Agent/Hapi, retained the full path in the button title, and restored the full path to the directory input after clicking.
  • bun run build — passed.

Related Issues

None.

AI Disclosure

Implementation and tests were assisted by OpenAI Codex (GPT-5.6).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • [Minor] Recent-path buttons lose their unique accessible name; see the inline finding.

Questions

  • None.

Summary

  • Review mode: initial
  • One minor accessibility regression found. No other correctness, security, data-loss, performance, or maintainability issues found in the modified lines.

Testing

  • Not run (automation); PR code was not executed. GitHub checks were pending at review time.

HAPI Bot

title={path}
>
{path}
{getPathDisplayName(path)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MINOR] Keep the full path as the accessible name

The compact text becomes the button's accessible name; title is only a fallback when the element has no other name. As a result, paths such as /work/client/Agent/Hapi and /archive/Agent/Hapi are both announced as Agent/Hapi, so assistive-technology users cannot tell which directory will be selected. Keep the compact visible text, but expose the full path semantically and update the role query in the regression test.

Suggested fix:

<button
    // ...
    title={path}
    aria-label={path}
>
    {getPathDisplayName(path)}
</button>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • None.

Questions

  • None.

Summary

  • Review mode: follow-up after new commits
  • No correctness, security, regression, data-loss, performance, or maintainability issues found in the latest modified lines. The new commit resolves the prior accessible-name finding by preserving the full path in aria-label; the complete latest diff was re-reviewed. Residual risk: GitHub test and integration checks were still pending at review time.

Testing

  • Not run (automation); PR code was not executed. Added tests cover POSIX and Windows compact formatting plus full-path click/accessibility preservation. GitHub test and integration checks pending.

HAPI Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant