Skip to content

Conversation

Ammaar-Alam
Copy link

@Ammaar-Alam Ammaar-Alam commented Sep 4, 2025

(Continuing from the discussion in PR #2753 and issue #2730)

i think discoverability with a lot of the current shortcuts is lacking, thought something like this might be helpful.
didn't begin this from an issue beforehand, nor am i really sure if this overlay matches the style/tone that codex is going for, but i though smtg like this might be worth considering?


(AI-written description bc am lazy 🦭)

  • Rationale:
    • Reliability: Ctrl+/ and Ctrl+? vary across terminals; F1 is not present on many compact keyboards;
      Ctrl+\ sends SIGQUIT. Ctrl+O is consistent, unused elsewhere in the TUI, ergonomic, and works uniformly
      in the app.
    • Clarity: One obvious toggle for open/close, concise footer, and an overlay with clear sections
      reduces cognitive load.
  • Tests & Snapshots:
    • Updated TUI snapshots to reflect the new footer and narrow‑width truncation. This includes
      chat composer and chatwidget snapshots (narrow widths now show truncated footer lines containing “⌃O
      shortcuts ⌃C” when space is constrained).
    • All tests pass locally after snapshot updates.
  • Backwards Compatibility:
    • No configuration or API changes.
    • Ctrl+T transcript remains available; it’s just not advertised in the footer anymore (listed in the
      overlay instead).
    • Esc‑based backtrack behavior is unchanged and still appears contextually as “Esc edit prev”.

Summary

  • Replaces unreliable shortcuts with a single, consistent toggle: Ctrl+O.
  • Reorganizes overlay into intuitive groups and adds “Ctrl+V paste image”.
  • Updates footer and overlay hints for clarity; removes confusing dynamic hints.
  • Updates TUI snapshots to reflect the new footer and narrow‑width truncation; all tests pass.

Rationale

  • Reliability: Ctrl+/ and Ctrl+? vary across terminals; F1 not available on many compact keyboards;
    Ctrl+\ sends SIGQUIT. Ctrl+O is consistent, unused elsewhere in the TUI, and ergonomic.
  • Polish: One obvious key for open/close + clear sections avoids confusion.

User‑Facing Changes:

  • Shortcuts Overlay: Ctrl+O opens/closes the shortcuts overlay anywhere; overlay can also be closed
    with Esc, q, or Ctrl+C.
  • Overlay Groups:
    • Compose: Enter send; Shift+Enter/Ctrl+J newline; Ctrl+V paste image
    • Edit: Ctrl+U clear line; Ctrl+H delete left; Alt+Backspace delete word left; Ctrl+K clear to end
    • Navigate: Alt+←/→ word jump; ↑/↓ previous/next entry
    • Overlays: Ctrl+O shortcuts; Ctrl+T transcript
    • Backtrack: Esc Esc edit previous
  • Footer: Shows “⏎ send”, newline hint (Shift+⏎ when enhanced keys supported, otherwise ⌃J), “⌃O
    shortcuts”, and “⌃C quit”. Transcript hint is removed from the footer to keep it focused; transcript
    remains available on Ctrl+T and listed in the overlay.
  • Overlay Hints: Minimal hints (“↑/↓ scroll” and “Ctrl+O close” on the first line; “q quit” on the second)
    for the shortcuts overlay.
  • Implementation Notes:
    • ChatComposer gains a use_shift_enter_hint boolean to preserve main’s “Shift+Enter vs Ctrl+J”
      newline hint selection.
    • Footer construction uses the shared key hint helpers for platform‑aware styling.
    • The shortcuts overlay content is created via Overlay::new_static_with_title_minimal_hints, with
      the grouped sections above.

CleanShot 2025-09-05 at 15 36 05@2x CleanShot 2025-09-05 at 15 37 16@2x

CleanShot 2025-09-05 at 15 40 16

@Ammaar-Alam Ammaar-Alam marked this pull request as draft September 4, 2025 21:24
@Ammaar-Alam Ammaar-Alam marked this pull request as ready for review September 5, 2025 19:42
@Ammaar-Alam
Copy link
Author

dare i mention 🫣 @edward-bayes @nornagon-openai @easong-openai
(pls review saur i can add a codex contribution to my resume for openai's swe internship before applying 😋 )

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