Highlight Session commands in composers

Merged
GJ
12d ago
+799-38

What type of PR is this?

/kind feature

What this PR does / why we need it:

Typing !make test or /goal pause currently leaves users unsure whether they are submitting a message or a Session command. Give recognized commands a distinct composer presentation while users type.

The web composer highlights the command prefix, uses amber shell styling and green goal styling, and shows the matching submit action. Arguments remain readable, and removing the command prefix restores the ordinary message composer. The interactive terminal colors shell and goal input and shows the action Enter will submit.

Explain and block incomplete commands, unavailable goal support, and commands that conflict with staged attachments or pending work. Keep the draft when submission is blocked. Keep unknown prefixes such as /goalkeeper as ordinary messages.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

The web editor uses a native textarea with an inert highlighting layer. The layer shares the textarea's font and wrapping dimensions and follows its scrolling. Returning to Conversation or Sessions, scrolling, and resizing the viewport refresh its alignment; hidden composers retain their measured dimensions.

Validation:

  • make verify
  • env -u CODEX_HOME -u CODEX_AUTH_JSON make test
  • make build WHAT=cmd/kelos
  • Chromium checks of command submission, validation guidance, text selection, multiline scrolling, navigation through Changes and Terminal, background events while the composer is hidden, light and dark themes, and layouts at 320, 360, and 390 pixels

The unit suite runs with inherited Codex settings removed from the test process; an entrypoint failure with those settings reproduces on main.

Review disposition: the command validation, whitespace handling, cancel/disconnect hints, hidden-composer alignment, dark error contrast, documentation, and event-hook coverage findings are addressed. Duplicate alignment reports share one fix; the findings on outdated documentation and CSS locations still applied and are addressed.

The pending-edit label suggestion is not applied: runtime editMessage reparses the saved text and supports changing pending work into a command. The hint therefore keeps the command type and explicitly says “save pending work”; a positive submission test covers this path. Commands with attachments are rejected by the runtime, rather than sent as ordinary agent prompts; the TUI blocks them locally and retains the draft and files. Goal commands remain available during active work so an active goal can still be controlled.

Screenshots use the production frontend with a fixture Session and matching input and conversation in each pair.

ViewBeforeAfter
Shell command, desktopBefore: shell command, desktopAfter: shell command, desktop
Goal command, desktopBefore: goal command, desktopAfter: goal command, desktop
Shell command, mobileBefore: shell command, mobileAfter: shell command, mobile
Incomplete goal, dark desktopBefore: incomplete goal, dark desktopAfter: incomplete goal, dark desktop

Does this PR introduce a user-facing change?

Session composers highlight shell and goal commands while typing. The web composer gives commands distinct styling, shows command-specific submit actions, and explains incomplete or unavailable commands.