Skip to content

feat(neo-tui): real port for app.suspend, app.session.new, scoped overlay routing#17

Merged
code-yeongyu merged 1 commit into
mainfrom
feat/neo-tui-extended-port
May 20, 2026
Merged

feat(neo-tui): real port for app.suspend, app.session.new, scoped overlay routing#17
code-yeongyu merged 1 commit into
mainfrom
feat/neo-tui-extended-port

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented May 20, 2026

What

Round 13 of the senpi --neo legacy-feature port. Lands app.suspend, app.session.new, and scoped-overlay routing for 27 actions as real behavior. Strips narrative comments per pi-comment-checker priority 4.

Concrete changes

  • app.suspend (Ctrl+Z) → real SIGTSTP. New AppAction::Suspend + TerminalEventOutcome::Suspend + run_suspend. The run loop tears down the TUI and shells out kill -TSTP $$ on Unix; fg re-enters with state intact. Non-Unix surfaces a chat error.
  • app.session.new → real Command::NewSession. New AppAction::NewSession + Command::NewSession { id }. Reuses the backend's existing session-create flow.
  • Scoped overlay actions get dedicated predicates. Session-overlay (9 ids), tree-overlay (11 ids), models-overlay (7 ids) actions route through note_session_overlay_scoped_action / note_tree_overlay_scoped_action / note_models_overlay_scoped_action instead of falling into the generic "not yet wired" string. The notes name the parent overlay.
  • ADVERTISED_BUT_UNIMPLEMENTED_ACTIONS shrunk from 30 → 1 (only app.clipboard.pasteImage remains).
  • Stripped narrative // Round N / real port: comments per pi-comment-checker priority 4. Extracted small note_and_dispatch helper (3 call sites; not single-call-site) so execute_action stays under clippy's 100-line cap.

Tests

345 passing (was 341 after Round 12). Five new tests cover suspend / new-session dispatch and the three scoped-overlay predicates:

  • ctrl_z_app_suspend_dispatches_real_suspend_action
  • app_session_new_fires_new_session_command
  • session_overlay_scoped_actions_route_through_scoped_helper
  • tree_overlay_scoped_actions_route_through_scoped_helper
  • models_overlay_scoped_actions_route_through_scoped_helper

Updated unimplemented_slash_command_visibly_notifies_user to target app.clipboard.pasteImage since app.session.new is real.

Gates

  • cargo fmt --package senpi-neo-tui -- --check — green
  • cargo clippy --package senpi-neo-tui --all-targets -- -D warnings — green
  • cargo test --package senpi-neo-tui -j 1 — 345 passed
  • npm run check (899 files) — green

Summary by cubic

Adds real Ctrl+Z suspend, a working “new session,” and scoped overlay routing in neo-tui, cutting unimplemented actions to one and improving user feedback.

  • New Features

    • Ctrl+Z (app.suspend) sends SIGTSTP; terminal restores after fg. Non-Unix shows a chat error.
    • app.session.new now fires Command::NewSession.
    • 27 overlay-scoped actions (session/tree/models) use dedicated predicates and push clear notes naming the required overlay.
  • Refactors

    • Shrunk ADVERTISED_BUT_UNIMPLEMENTED_ACTIONS from 30 to 1 (app.clipboard.pasteImage).
    • Extracted note_and_dispatch and removed narrative comments to keep execute_action lean.
    • Tests updated; total now 345 passing.

Written for commit 470247d. Summary will update on new commits. Review in cubic

…rlay routing

Round 13 of the senpi --neo legacy-feature port lands three more pieces of
the legacy action surface as real behavior and tightens the routing for
actions that legitimately do nothing outside their parent overlay.

- app.suspend (Ctrl+Z) now actually suspends the TUI via SIGTSTP. New
  AppAction::Suspend + TerminalEventOutcome::Suspend + run_suspend
  helper. The run loop tears down the TUI (raw mode off, alt screen
  off, bracketed paste off, Kitty flags popped) and shells out
  'kill -TSTP $$' on Unix so the user lands at the shell prompt;
  'fg' re-enters the TUI. Non-Unix platforms surface a chat error.
- app.session.new now fires the real Command::NewSession instead of
  stubbing as unimplemented. New AppAction::NewSession + Command::NewSession.
- Session / tree / models overlay-scoped actions (27 ids) get
  dedicated predicates (is_session_overlay_scoped_action,
  is_tree_overlay_scoped_action, is_models_overlay_scoped_action) and
  matching note_*_overlay_scoped_action helpers that name the parent
  overlay so the user understands the chord is scoped instead of
  getting a generic 'not yet wired' string.
- ADVERTISED_BUT_UNIMPLEMENTED_ACTIONS shrunk from 30 entries to 1
  (app.clipboard.pasteImage), the legitimate remaining gap.
- Stripped narrative 'Round N / real port' comments per
  pi-comment-checker priority 4. Behaviour explained by tests, not
  by trailing comments. Extracted small note_and_dispatch helper
  (3 call sites) so execute_action stays under clippy's 100-line cap.

Tests: 345 passing (was 341 after round 12). New: ctrl_z_app_suspend_
dispatches_real_suspend_action, app_session_new_fires_new_session_
command, session_overlay_scoped_actions_route_through_scoped_helper,
tree_overlay_scoped_actions_route_through_scoped_helper, models_
overlay_scoped_actions_route_through_scoped_helper. Updated
unimplemented_slash_command_visibly_notifies_user to target
app.clipboard.pasteImage since app.session.new is real.

cargo fmt --check, cargo clippy --package senpi-neo-tui
--all-targets -- -D warnings, and npm run check (899 files) all
green.
@code-yeongyu code-yeongyu merged commit ecc0166 into main May 20, 2026
1 of 2 checks passed
@code-yeongyu code-yeongyu deleted the feat/neo-tui-extended-port branch May 20, 2026 02:57
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