Repository navigation
feat(footer): add cwd-base segment for last-segment directory display - #628
cuipengcx90 wants to merge 2 commits into
Conversation
A deep repository path can consume most of a footer row, and OpenPI resolves an over-wide row by dropping whole segments by priority rather than shortening a segment. A long cwd therefore hides other metrics instead of yielding space itself: in a 150-column terminal the full path plus a long branch name leaves no room, so `git` disappears even though the branch changes most often. Add a `cwd-base` footer segment that renders only the last path segment, whose width is bounded by the directory name regardless of repository depth. `cwd` keeps its current full-path rendering and the default layout is untouched, so existing configurations render exactly as before. - register the segment in FOOTER_ITEMS, which also makes it reachable from the ui_footer_lines and ui_footer_items tool schemas - describe both directory metrics in /openpi-setup, SETUP.md and README.md - cover basename fallbacks (root paths) and a rendered layout in tests
tt-a1i
left a comment
There was a problem hiding this comment.
Integration review at exact head 2857014e5080c0cd06260ab1b702c60e7522a5fc against current main 1c4d3318ae9cfd207255820246f7041821fb36da: git merge-tree --write-tree reports 1 content conflict(s): SETUP.md. The existing branch CI does not validate the resolved integration. Please resolve these conflicts against current main and run CI on the resulting exact head before requesting merge. This comment covers the integration blocker; it does not claim a full source review of the PR.
tt-a1i
left a comment
There was a problem hiding this comment.
Exact reviewed head: 2857014e5080c0cd06260ab1b702c60e7522a5fc.
The optional cwd-base footer segment has independent value. Current-main integration conflicts in SETUP.md; reconcile the shared configuration/status/docs contract, then revalidate the resulting head. This comment does not claim the feature is already merge-ready.
Verification: prior exact-head Standards and Spec evidence reused because this head is unchanged; current review/CI/integration metadata refreshed. No complete-suite rerun, installed-runtime/provider run, or visual acceptance performed in this update.
Current-main integration also conflicts; final validation must cover the reconciled head.
Problem
Long working-directory paths take footer space even when only the final directory name is needed.
Value
Users can opt into a shorter
cwd-basesegment while keeping the existing fullcwditem, default layout and presets.Approach
Add
cwd-baseto the canonical item catalog, priority/colors, renderer and legacy flat-item adapter. Use platform path semantics, sanitize terminal labels before extracting the basename, and retain filesystem-root labels. Complete the episode-scoped setup schema/guidance, existing dynamic status, README and SETUP contract. Names can still be long; this is not a fixed-width promise.Integrate fixed main
f98d6a47incrementally, preserving all current appearance, limits and setup fields plus the contributor history.Validation
Final local head
5fa91fb24349b9921ff5ffa4fb1285c77718e5fb, tree4f08da43a1fbbc6da8835badf4f0295a2e2bc889; full logs are recorded externally.ui_footer_linesand flatui_footer_itemsboth persist the selected item, retain canonical-only storage and report it in no-argument status; default/preset behavior is covered./openpi-setupand the real typed configuration tool, persistingcwd-base. Native 150-column output shows basename, branch, model and context; 40-column output retains basename and operational status while lower-priority metrics are hidden. Equivalent full-cwdcaptures are retained. Evidence is raw native TTY output, not a reconstructed screenshot.bun run check/bun run test: both exit 0. Node: 2,454 passed, 9 skipped; Web UI: 88 files / 1,338 passed.Two independent final reviews passed on this exact head. Fresh remote CI and independent last-push approval remain merge gates.
Final-head remote CI passed all 18 checks: 38699913359. Independent GitHub approval still gates merge.
Impact
cwd.win32checks, with actual Windows terminal acceptance left to cross-platform CI.