Skip to content

fix(session-ui): show the folder a search or listing ran in, not its parent - #65460

Merged
Hona merged 2 commits into
devfrom
tool-folder-subtitle
Nov 21, 2026
Merged

Hona merged 2 commits into
devfrom
tool-folder-subtitle

Conversation

@Hona

@Hona Hona commented Nov 21, 2026

Copy link
Copy Markdown
Member

Screenshots

A session's tool group, expanded, in the desktop app on Windows (dev build; the same view on every platform). The agent called Glob with no folder and Grep with path: "src".

State Before After
Grep in src Before: Grep shows "/" After: Grep shows "src"

Glob shows / in both: it searched the project itself.

Issue for this PR

No linked issue.

Type of change

  • Bug fix

What does this PR do?

The subtitle of a search or listing (Grep, Glob, List, and the grouped context rows) named the parent of the folder the tool ran in. displayDirectory takes a file path and drops its last part, but these tools pass a folder, so src became / and src/lib became src.

A new displayFolder shows the folder itself, relative to the project, and / for the project or no folder. The search and listing subtitles in both timelines use it; file rows (patches, edits) keep displayDirectory.

How did you verify your code works?

  • The screenshots above: a dev build of dev and of this branch, the same session.
  • bun typecheck in packages/session-ui, bun run lint:changed origin/dev clean. No unit test: tool-renderer.tsx has no test beside it, and the new function reads the session's directory from its context.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I checked the new displayFolder logic in isolation, since the timeline is desktop/web only and I couldn't render it here. No folder and the project folder (with or without a trailing slash) both show /. Relative and absolute subfolders show their own path relative to the project. On the base, src showed as / and an absolute subfolder showed as an empty subtitle. tsc --noEmit passes in packages/session-ui.

The public API is unchanged: this only touches session UI rendering.

No concerns.

@Hona
Hona merged commit 0663368 into dev Nov 21, 2026
11 checks passed
@Hona
Hona deleted the tool-folder-subtitle branch November 21, 2026 23:24
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
1 task
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