Skip to content

feat: Slash /config: left/right arrows navigate its multi-level menus (Right should drill in, not close)#393

Merged
andrei-hasna merged 5 commits into
mainfrom
factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67
Jul 25, 2026
Merged

feat: Slash /config: left/right arrows navigate its multi-level menus (Right should drill in, not close)#393
andrei-hasna merged 5 commits into
mainfrom
factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Objective

Slash /config: left/right arrows navigate its multi-level menus (Right should drill in, not close)

/config now has multiple levels but Right currently just closes it. Make Left/Right arrows navigate the config menu tree: Right enters a sub-level, Left goes back a level (Esc/Left at top closes). Keep it consistent across every /config sub-menu. The agent MUST start a goal plan for this task and drive it node by node (this is required). Investigate the current codewith implementation first and cite file:line. Build/test on remote Blacksmith only (never compile locally); keep cargo fmt (--config imports_granularity=Item), clippy --tests --all-targets -D warnings, and prettier clean; land a PR into hasna/codewith main.

Verification

  • install: pass

Run run_3d59e70fd373 · backend codewith · task b4380f3e-c1d6-44bd-9c19-9810abd736df
🏭 Generated by @hasnaxyz/factory

@andrei-hasna
andrei-hasna force-pushed the factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67 branch 2 times, most recently from 1826633 to f2312ba Compare July 24, 2026 18:54
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Rebased onto current origin/main (86b7e78) and force-pushed as f2312ba.

Scope of the change (TUI only, codex-tui):

  • SelectionViewParams::tree_navigation_enabled opt-in on ListSelectionView: move_right drills into a row that opens a sub-menu (only when the row is enabled, has actions, and is marked dismiss_parent_on_child_accept), move_left mirrors cancel/Esc and goes back one level (closes at the root).
  • /config root, section, agent-max-threads, goal-objective and usage-limit-reset pickers now keep the parent view on the stack (dismiss_on_select: false + dismiss_parent_on_child_accept: true) so Left/Esc returns one level instead of tearing the whole tree down. This reuses the pre-existing dismiss_after_child_accept stack logic in bottom_pane/mod.rs, so accepting a leaf still closes the whole tree exactly as before.
  • Footer hints are derived from the live ListKeymap (tree_navigation_hint_line) instead of hardcoded key names, so a rebound move_left/move_right/accept/cancel advertises the right keys.
  • New coverage: config_popup_arrow_keys_navigate_menu_tree and config_usage_limit_reset_left_and_escape_return_one_level, plus a snapshot for the agent-max-threads popup.

Build gate — Blacksmith testbox run 30118723509, blacksmith-16vcpu-ubuntu-2404, conclusion success:

cd codex-rs && cargo clippy -p codex-tui --tests --all-targets -- -D warnings && cargo nextest run -p codex-tui --no-fail-fast

clippy: 0 warnings. nextest: 3487 tests run: 3487 passed, 4 skipped. Repo CI on this SHA is green as well (Format / etc, Bazel clippy/test, release builds).

@andrei-hasna
andrei-hasna force-pushed the factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67 branch from f2312ba to 47a984b Compare July 24, 2026 19:07
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Re-rebased onto origin/main @ 027a439 (main advanced with #396 mid-run; clean rebase, no overlapping files) and re-proved on the final SHA 47a984b.

Blacksmith testbox run 30119607160blacksmith-16vcpu-ubuntu-2404, conclusion success:

cd codex-rs && cargo clippy -p codex-tui --tests --all-targets -- -D warnings && cargo nextest run -p codex-tui --no-fail-fast

clippy: 0 warnings. nextest: 3489 tests run: 3489 passed, 4 skipped, including config_popup_arrow_keys_navigate_menu_tree and config_usage_limit_reset_left_and_escape_return_one_level.

andrei-hasna and others added 4 commits July 25, 2026 07:42
The root /config menu's "Goal objective limit" entry still dismissed the
parent on select, so Right did not drill in and Left/Esc in the picker
closed the whole menu instead of going back one level. Mark it as a
child-opening entry and enable tree navigation on its picker so every
root entry behaves consistently.
…ist keymap

Footer hints for the tree-navigating /config menus were hardcoded English key
names, so a rebound move_left/move_right/accept/cancel would advertise the
wrong keys. Resolve the labels from the live ListKeymap the same way
standard_popup_hint_line_for_keymap already does.
… only advertise real drill-in keys

Resolve the target section positions in config_popup_arrow_keys_navigate_menu_tree from
common_config_sections() instead of hardcoded Down-press counts and ordinals, so inserting a
new CommonConfigSection cannot silently retarget the test.

Replace TreeNavigationHint's accept_label/include_move_right pair with a TreeNavigationAccept
enum (None/InPlace/DrillIn) and derive the section-popup variant from whether the menu actually
contains a row that opens a child view (SelectionItem::opens_child_view, now the single source of
truth shared with move_right handling). Toggle-only section menus no longer advertise a drill-in
key that does nothing.
@andrei-hasna
andrei-hasna force-pushed the factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67 branch from 47a984b to ed8c00e Compare July 25, 2026 04:55
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Rebased onto current main + merge-result gate

Head: c46c3be8e — rebased onto origin/main@54333c9e0 (merge base == current main, so the branch head is the merge result).

Merge-result failures fixed

  1. config_popup_arrow_keys_navigate_menu_tree — main feat: Add a self-healing config category to codewith that auto-recovers from errors like 'Selected model is at capacity' (retr #401 inserted CommonConfigSection::SelfHealing into COMMON_CONFIG_SECTIONS, which shifted the hardcoded Down-press counts and rendered ordinals. Row positions are now resolved from common_config_sections() (plus the two rows the root menu always appends), so a future insertion cannot silently retarget the test. Same treatment applied to config_usage_limit_reset_left_and_escape_return_one_level, which had assumed Account & automation stays first.
  2. codex_tui__chatwidget__tests__config_self_healing_popup.snap (added by feat: Add a self-healing config category to codewith that auto-recovers from errors like 'Selected model is at capacity' (retr #401) regenerated for the new footer.
  3. Footer honesty: SelectionItem::opens_child_view() is now the single source of truth for tree navigation — move_right only fires on rows that actually open a child view, and TreeNavigationAccept (None/InPlace/DrillIn) makes a section menu advertise a drill-in key only when it really has one. Toggle-only sections now render space toggles; ← or esc goes back instead of falsely promising → or enter opens.

Blacksmith testbox gate (merge result)

Run 30144986752 on blacksmith-16vcpu-ubuntu-2404, ref c46c3be8econclusion: success.
Build command: just clippy --all-targets -- -D warnings && just test -p codex-tui

  • workspace clippy --tests --all-targets -D warnings: clean (5m07s)
  • cargo nextest run -p codex-tui: 3507 tests run, 3507 passed, 4 skipped

The branch-only run before the rebase was green too; this one is green against current main.

@andrei-hasna
andrei-hasna merged commit 2bfe6ad into main Jul 25, 2026
28 checks passed
@andrei-hasna
andrei-hasna deleted the factory/b4380f3e-c1d6-44bd-9c19-9810abd7-82fe8d67 branch July 25, 2026 05:15
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant