Skip to content

feat(footer): add cwd-base segment for last-segment directory display - #628

Open
cuipengcx90 wants to merge 2 commits into
openpi-dev:mainfrom
cuipengcx90:feat/footer-cwd-basename
Open

cuipengcx90 wants to merge 2 commits into
openpi-dev:mainfrom
cuipengcx90:feat/footer-cwd-basename

Conversation

@cuipengcx90

@cuipengcx90 cuipengcx90 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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-base segment while keeping the existing full cwd item, default layout and presets.

Approach

Add cwd-base to 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 f98d6a47 incrementally, preserving all current appearance, limits and setup fields plus the contributor history.

Validation

Final local head 5fa91fb24349b9921ff5ffa4fb1285c77718e5fb, tree 4f08da43a1fbbc6da8835badf4f0295a2e2bc889; full logs are recorded externally.

  • Frozen dependencies installed.
  • Focused footer/setup/shared-config suite: 107 passed. Final footer checks additionally cover POSIX/Windows drive/UNC roots, slash forms, trailing separators, Unicode, CSI/OSC sanitization and 20/40/80/150-column fitting.
  • Canonical ui_footer_lines and flat ui_footer_items both persist the selected item, retain canonical-only storage and report it in no-argument status; default/preset behavior is covered.
  • Actual isolated Pi 1.2.0 TUI loaded this worktree as its unique OpenPI source. A deterministic loopback provider exercised /openpi-setup and the real typed configuration tool, persisting cwd-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-cwd captures are retained. Evidence is raw native TTY output, not a reconstructed screenshot.
  • No external/paid model call or global Pi configuration change. Global Pi 1.1.0 attempts were excluded; acceptance uses this checkout's pinned Pi 1.2.0 runtime.
  • External combined feat(footer): add cwd-base segment for last-segment directory display #628/feat(web): persist language preference #359 configuration and setup/footer compatibility probe passes; branches remain independent.
  • 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

  • User-visible: one optional footer item; defaults remain full cwd.
  • Model-visible: setup item enum/guidance adds the option; ordinary tools are unchanged.
  • Runtime/lifecycle: existing TUI footer projection and width priority apply immediately.
  • Persisted configuration/data: existing canonical footerLines can contain the additive item; no migration or default rewrite.
  • Compatibility/risk: platform path handling and terminal sanitization retain roots and earlier defaults; Windows paths are deterministic win32 checks, with actual Windows terminal acceptance left to cross-platform CI.

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
@github-actions github-actions Bot added documentation Improvements or additions to documentation area:setup OpenPI setup, configuration, or setup documentation area:ui Terminal UI, rendering, themes, or visual assets labels Sep 25, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

This branch has not been deployed

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

Labels

area:setup OpenPI setup, configuration, or setup documentation area:ui Terminal UI, rendering, themes, or visual assets documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants