Skip to content

feat(chat): restyle omp's ask dialogs and forms - #467

Closed
andrebrait wants to merge 34 commits into
ompweb-dev:mainfrom
andrebrait:feat/form-style
Closed

andrebrait wants to merge 34 commits into
ompweb-dev:mainfrom
andrebrait:feat/form-style

Conversation

@andrebrait

Copy link
Copy Markdown
Collaborator

Depends on #460: this branch sits on top of it, so until #460 merges the diff also shows #460's commits. Only the last commit (feat(chat): restyle omp's ask dialogs and forms) belongs to this PR.

Summary

With #460, omp's ask dialogs and forms arrive again as ui_request frames and are rendered from their arguments. This restyles them (components/ExtensionDialog.tsx, app/globals.css):

  • One row style for every choice: pick lists, approvals, ask options and form radios/checkboxes share one 8px-radius row (36px; 40/44px with the larger touch-target setting). Checked and pre-checked choices are highlighted; before, form rows had no highlight and pre-checked ones only showed a small ☑.
  • Focus: outline: none hid keyboard focus on text fields; the app's focus ring is back, around the whole row for "Other".
  • Fields: borders at ≥3:1 contrast on the darkest themes, a red border after a failed Submit (:user-invalid), and text fields follow the touch-target setting.
  • Forms: bold legends, field labels as their own block, muted intro text. "Done selecting" is a dashed, centred action row; footer hover moved from JS to CSS; approval details sit in a mono block.
  • Warm dark theme: adds color-scheme: dark, so native controls there are dark. This affects every native control in that theme.

Behaviour and wording are unchanged.

Verification

  • Every dialog variant (select, checkbox, confirm, input, editor, approve, ask, form) screenshotted before and after at desktop and 390px width, plus light and warm-dark themes, a failed Submit and the larger touch targets. Three critique rounds with GPT 6.1 Sol; the last had no substantive findings.
  • ExtensionDialog*.test.mjs (5 files, 49 tests) pass; two mobile-overflow assertions ([Bug] question tool layout  #234) moved from inline styles to the CSS class and rule. Typecheck and eslint clean.
  • Not checked: real keyboards and physical phones.

Start of a custom omp entry that would host ompweb sessions over a local
socket. Paused: omp collab already covers most of the design, and the
direction (collab guest, custom build or hybrid) is pending.
runner/ is ompweb's own omp build on pinned @oh-my-pi/pi-coding-agent 18.19.0.
src/cli.ts stands in for upstream cli.ts as the process entry and swaps the
launch command for one whose session factory (src/session.ts) shares every
session through the host's loopback collab relay (runtime overrides only)
and attaches the NDJSON control socket (src/control.ts: get_state, set_model).
src/relay.ts is the loopback relay; scripts/ holds the guest and host probes.

Verified: --smoke-test ok; stock and runner TUIs joined by the guest probe;
a guest prompt raised an ask that the guest answered; set_model over the
control socket switched the TUI model and reached the guest as entry+state.
Drop the collab relay, overrides and guest probe. The session factory now
connects src/channel.ts: hello with the session file, every AgentSession
event, commands (get_state, set_model, prompt, abort) against the same
AgentSession the TUI drives, and dialogs raced between the TUI and the host
by wrapping the tool UI context (first answer wins, the other side closes).

Verified: --smoke-test ok; a host-sent prompt opened an ask whose whole HTML
form (checked state included) reached the host as formDialog; the host
answer closed the TUI form; a TUI answer sent ui_end to the host.
src/commands/ holds one CommandTable and FrameTable per group (prompting,
model, session, tools, agents) behind a shared CommandContext; the channel
dispatches cmd frames by op and other host frames by t.
Agents were cut off mid-task; this preserves their partial edits
(runner headless/events/correlation, ompweb process/daemon/manager/auth,
TUI attach socket, release/smoke), plus the spec and DESIGN/AGENTS updates.
Not verified as a whole.
Skill diagnostics came from an unmerged omp PR that the pinned runner
lacks; the feature, its setting toggle and docs are removed. Root tsconfig
excludes runner/, which has its own. E2E (server+daemon+compiled runner):
prompt, whole ask form with pre-checked default, set_model+edit_message and
TUI attach all passed.
…layout

Fake omp children in host tests speak hello/cmd/res/event instead of RPC;
RemoteRpcTransport tags link samples from hello/session frames. The web ask
form adds the automatic Other choice per radio/checkbox group, as omp does.
Fake hosts and workers in agent-tools, api-contract, message-outbox-review,
outbox-handoff, session-resume and session-routes speak hello/cmd/res/event;
the rename-during-edit test holds a native edit_message command. The late
second RPC response case is gone: the channel reports it as prompt_error.
Both handlers existed but were missing from the command table, so the
daemon's event filter and the outbox status probe got unknown-command errors.
The root suite ignores runner/** (its deps live in runner/node_modules);
runner gets a typecheck and bun test job on PRs that touch it. zh-TW, added
on main, still carried the removed skill-diagnostics keys.
…p dirs

npm test lists the app directories instead of ignoring runner/** (the
ignore glob missed Windows paths). Smoke needs a real runner: CI builds it
first, and packed-install smokes pass it with --omp until the per-platform
runner packages are published.
…ing HOME

omp's daemon broker, LSP mux and embedding server detach and outlive the
session by design; on Windows they keep the throwaway HOME locked.
…ng it

The server closes the peer dialog without waiting for omp, so the child's
answer record can land after the cancel frame (seen on Windows CI).
A freshly copied runner binary's first start on Windows waits on the
antivirus scan; the 10 s probe reported omp as missing for the whole
daemon session. Smoke waits up to 60 s for the link.
The runner cannot add clientMessageId to omp's entries, so it journals
{clientMessageId, entryId} in a custom entry. The session reader now takes
the id from either source, on the active branch only, for outbox
reconciliation, full context and history pages.
Runner: headless mode boots through runRootCommand's runSessionHost hook
(upstream PR pending; carried as a Bun patch of the exact diff) instead of
swapping omp's rpc-ui mode with a build plugin, and no runner module imports
omp's RPC helpers any more (prompt results, goals, session events and
settle, message paging, host tools/URIs, btw, dictation, live, subagents are
ported onto omp's non-RPC modules).

ompweb: the server passes the runner's ui_request/ui_end/ui frames through
unchanged and the browser renders each omp dialog method from its own
arguments, answering ui_response with the exact omp return value; the
extension_ui_* translation is gone.
Daemon: unowned res frames are dropped and startup configure is
fire-and-forget (a slow extension startup no longer resolves the web's
commands with stray replies); a TUI runner cannot attach to a session that
already has a live channel ({t:"refused"}); the host link moves to protocol
v10 (MIN = VERSION), deleting spawnLegacy, legacy channels and every older
version gate; a restarted server sees each event once and in order
(continuous rejoin); the host socket is created under umask 0177; numeric
string dialog ids are normalised; dead capability and lifecycle plumbing
removed.

Runner: only interactive TUIs dial the host, redialling stops after a
refusal, no dialling on Windows yet, open dialogs are re-sent after a
redial and ui_end follows a failed local dialog; tests now kill the
reviewer's mutants and cover edit_message.

Browser: agent forms with controls named like HTMLFormElement members
still submit. Docs: spec, README, AGENTS.md and DESIGN.md describe the
runner and its channel.
Fake daemons serve v10 open instead of the removed spawn op, hellos and
welcomes use LINK_PROTOCOL_VERSION, and the removed ready capability is
gone from expectations. Tests of below-v10 join blocks are deleted (such a
host is refused at link time); session-resume asserts that v10 hosts own
their runs. clusterJoinBlock drops its dead protocol parameter.
…ne redial test

On a slow socket (Windows' small loopback buffers) the resend outlasted the
test's ack hold: the released acks cover the lines main got before the drop,
so the daemon rightly skipped the rest of the resend and the test waited for
lines that would never come again. Hold acks until a full window is resent.
…e it listens

omp children spawned during the pending listen() (restored sessions at startup) inherited umask 0177, so every file and directory their tools created was 0600.
ompweb preflight starts the session omp as a new host session would (same resolver and spawn, --no-session, scratch cwd) and waits up to 30 s for its hello. The host updater and the web self-update worker run the candidate's preflight in the live environment before stopping anything and abort on failure. An npm ompweb host now resolves the runner from its own package.
…ently and is found by a marker only it embeds
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@andrebrait

Copy link
Copy Markdown
Collaborator Author

Moved to #472: the head branch now lives on this repository.

@andrebrait andrebrait closed this Nov 13, 2026
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