Skip to content

fix(ui): Return on a relative folder path browses into the highlighted folder - #163284

Merged
steipete merged 1 commit into
mainfrom
fix/ui-place-browser-relative-return
Oct 2, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/ui-place-browser-relative-return

Conversation

@steipete

@steipete steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Related: #163162

What Problem This Solves

Fixes: pressing Return in the New Session folder browser with a relative path typed (for example relative or C:packages) browsed into whichever folder of the current listing was highlighted and replaced the typed text.

User Impact

User impact: Return on a relative path now leaves the picker where it is and keeps what you typed; "Use this folder" stays disabled as before. Absolute paths, Windows drive roots (C:\, C:/), UNC paths, and an empty field behave exactly as before.

Why This Change Was Made

A relative draft cannot filter the listing, so the browser keeps showing the current folder's children with the first one highlighted. activate() checked the highlight before checking whether the draft was a usable path. It now gates on usablePath() first, matching the native macOS group-defaults browser from #163162 (ChatSessionGroupDefaultsSheet.swift activate()), which named this web path as follow-up work. Tab completion from the highlight is unchanged on both platforms.

Evidence

Reproduced and verified through the real entry point on the mocked Control UI (pnpm dev:ui:mock, fixture data only): New Session → Agent workspace → Browse folders at /Users/demo (Projects highlighted).

Input + Return Before After
relative browsed to /Users/demo/Projects, draft replaced stays at /Users/demo, draft relative, Use disabled
C:packages (drive-relative) browsed into highlighted folder (shown by the regression test, not captured live) stays put, draft kept
/Users/demo/Pro opens /Users/demo/Projects (same code path, not re-run live) opens /Users/demo/Projects (unchanged)

This is a behavior-only fix (no rendering or layout change), so the evidence is the boundary proof above plus the regression test rather than before/after screenshots.

Regression test: keeps a relative draft on Enter despite a highlighted folder (relative, C:packages) in place-browser-state.test.ts. It fails on the original code (fs.listDir called a second time for the highlighted folder) and passes with the fix.

  • pnpm test ui/src/pages/new-session/place-browser-state.test.ts --maxWorkers=1: 20/20 passed; whole-file wall 4.8–7.4 s on a loaded Mac (load ~30), new cases ~1 ms each.
  • oxfmt --check, oxlint on both files: clean.
  • pnpm tsgo:ui: no errors in touched code; the only errors are in packages/mermaid-renderer from a stale local mermaid install (11.17.2 vs pinned 12.0.0), unrelated to this change.
  • Codex autoreview (--max-priority P1): scoped-clean, no P0/P1 findings.

A relative draft cannot filter the folder listing, so the New Session place
browser kept the current folder's children highlighted and Return browsed into
the first one, replacing the typed text. Gate activate() on usablePath() first,
matching the native group-defaults browser from #163162; empty and absolute
drafts (including drive roots and UNC paths) keep their previous behavior.
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 1:30 AM ET / 05:30 UTC.

ClawSweeper review

What this changes

The shared web folder picker preserves relative path text when Return is pressed instead of opening the highlighted folder, with regression coverage for ordinary and Windows drive-relative paths.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release retain the reported defect. The narrow repair has meaningful regression coverage, and no introduced correctness or security findings were identified.

Priority: P2
Reviewed head: 16103250ad7f91d05a21aa52eb973e85c7325df4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with reported browser-boundary verification, inexpensive regression coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.
Evidence reviewed 9 items Pinned introduced repair: The merge-base-to-head patch moves the existing usable-path check before highlighted-folder navigation. It changes no rendering, configuration, protocol, persistence, or authorization contract.
Still necessary on main: Fetched main still checks the highlight first. Relative input retains the loaded listing, so Return reaches navigate(entry.path) and replaces the typed draft.
Latest release retains the defect: The same highlight-first activation logic is present in v2026.9.7; this repair is not already supplied by the latest release.
Findings None None.
Security None None.

How this fits together

The Control UI folder picker serves New Session and web session-group defaults. It combines typed paths with Gateway directory listings and turns keyboard input into folder navigation or selection.

flowchart TD
  A[Typed folder path] --> C[Shared folder picker]
  B[Gateway directory listing] --> C
  C --> D{Return with usable path?}
  D -->|No| E[Keep draft and current listing]
  D -->|Yes| F[Navigate highlighted folder or typed path]
  F --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -1, Tests +17. Total +16 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 6 -1
Tests 1 17 0 +17
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 22 6 +16

Review metrics

None.

Technical review

Best possible solution:

Keep path validation in the shared picker owner so both web consumers preserve invalid drafts while retaining existing absolute-path navigation and Tab completion.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes a clear path: load a folder with children, type a relative path, and press Return. Current main activates the retained highlight; the author also reports reproducing this through the running mocked Control UI.

Is this the best way to solve the issue?

Yes. Reusing the existing usable-path predicate before navigation repairs the shared owner without adding competing validation or changing valid-path behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b21e522e2ad1.

Labels

Label changes:

  • add P2: This repairs a bounded keyboard-navigation defect that unexpectedly replaces a user's typed folder path.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.

Label justifications:

  • P2: This repairs a bounded keyboard-navigation defect that unexpectedly replaces a user's typed folder path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied before/after observations exercise the production web picker through the running mocked Control UI and show that Return preserves a relative draft and current listing. The focused owner regression additionally covers drive-relative input; inspected native screenshots are unrelated supplemental context. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced repair: The merge-base-to-head patch moves the existing usable-path check before highlighted-folder navigation. It changes no rendering, configuration, protocol, persistence, or authorization contract. (ui/src/pages/new-session/place-browser-state.ts:99, 16103250ad7f)
  • Still necessary on main: Fetched main still checks the highlight first. Relative input retains the loaded listing, so Return reaches navigate(entry.path) and replaces the typed draft. (ui/src/pages/new-session/place-browser-state.ts:99, b21e522e2ad1)
  • Latest release retains the defect: The same highlight-first activation logic is present in v2026.9.7; this repair is not already supplied by the latest release. (ui/src/pages/new-session/place-browser-state.ts:99, c074824a27c9)
  • Actual keyboard entry point: The rendered path input calls activate() on Enter and completeHighlighted() on Tab. The Use this folder button already uses usablePath(), so this repair aligns Enter with the existing path contract while preserving Tab completion. (ui/src/pages/new-session/place-browser.ts:84, 16103250ad7f)
  • Focused regression coverage: The added table-driven cases start with a loaded, highlighted folder, type relative or C:packages, and verify that activation preserves both draft and listing without another directory request. They reuse fake timers and the existing fixture without adding a production test seam. (ui/src/pages/new-session/place-browser-state.test.ts:286, 16103250ad7f)
  • Reported browser-boundary verification: The captured PR body reports a before/after run through pnpm dev:ui:mock: New Session → Agent workspace → Browse folders at /Users/demo. Return on relative previously opened Projects; afterward the listing and typed draft remain, with Use disabled. It explicitly distinguishes live coverage from the drive-relative regression test and reports 20 passing tests with measured cost. These observations were supplied by the author; this read-only review did not execute the app or tests. (16103250ad7f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit d507b68 into main Oct 2, 2026
89 checks passed
@steipete
steipete deleted the fix/ui-place-browser-relative-return branch October 2, 2026 05:50
@steipete

steipete commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 3, 2026
…penclaw#163284)

A relative draft cannot filter the folder listing, so the New Session place
browser kept the current folder's children highlighted and Return browsed into
the first one, replacing the typed text. Gate activate() on usablePath() first,
matching the native group-defaults browser from openclaw#163162; empty and absolute
drafts (including drive roots and UNC paths) keep their previous behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant