Skip to content

feat(hq): redesign HQ to the approved design, and use the SDK's dismiss, allow-always and stop - #980

Merged
Blind-Striker merged 2 commits into
masterfrom
feat/hq-redesign
Nov 23, 2026
Merged

Blind-Striker merged 2 commits into
masterfrom
feat/hq-redesign

Conversation

@Blind-Striker

Copy link
Copy Markdown
Collaborator

📝 Description

What does this PR do?

It redesigns HQ, the Blazor playground app, to the approved design, and makes HQ use what the SDK already offers where upstream's own app uses it.

The board applies a session's later title.

  • HQ read a session once, on SessionCreated, before the server had named it, and it ignored SessionRenamed. A session made in HQ therefore kept a blank title, and its row had nothing to click.
  • The board now applies SessionRenamed, and an untitled row links as "Untitled session".

The redesign:

  • Look: a token-based dark stylesheet, a 13/15/18/24 px type scale, and a status shape beside each status colour. The viewport meta tag is new.
  • Board: a "Needs you" queue whose cards carry the session's name, beside a sessions table that becomes stacked rows on narrow screens. Folders show their name, with the full path as a tooltip.
  • Session page: two columns.
    • The conversation: answers rendered as Markdown (Markdig, HQ only, with raw HTML disabled), and a sticky composer that stays on screen.
    • A rail with Changes and Terminal tabs, where diffs are coloured.
  • New session: the page now has the shared layout.
  • SDK calls: the "How this screen works" panel becomes a bottom dock behind a "Show SDK calls" header button. Its snippets are numbered and scroll sideways instead of breaking mid-word, and its open state is kept in localStorage.
  • States:
    • the empty board says what to do;
    • the disconnected message shows once;
    • the keyboard focus ring shows on every control;
    • the running mark stops under prefers-reduced-motion.

Asks and forms, following upstream's app at the pin (opencode 2.3.2):

  • Permission cards:
    • Buttons: Deny, Allow always and Allow once, in the app's order. Allow always replies PermissionReply.Always, and the server saves the rule.
    • Kind line: the app's settings.permissions.tool.<action>.description strings. An action with no description shows as code, as in the app.
    • Content, in the app's order: the server's Message, metadata.input, then the resources.
    • On a session page, the heading is "Permission required".
  • Edit preview: an edit ask shows a preview of each file from metadata.files[].patch. Upstream's TUI shows the same preview; the app does not.
  • Question forms: the cards show the field's question text, the option descriptions, and a labelled free-text box, with Submit and Dismiss. Dismiss calls SessionClient.CancelFormAsync.
  • Stop: the composer shows Stop while a turn runs. It calls InterruptAsync with Resume = true and ignores a refusal, as the app does.
  • Dock snippets: the dismiss, the stop, and all three permission decisions each have a snippet.

Stale asks. When a turn is interrupted, upstream's server drops the pending ask without publishing an event (anomalyco/opencode#55678, confirmed at 2.3.2).

  • Following the app, a session page re-lists that session's pending permissions and forms when it opens. Reconnects already re-seed the board.
  • The board also re-lists a session's asks when one of its turns ends, except on a shutdown. This goes beyond upstream's app; HQ's README records it with its reason, and it is removed when upstream publishes the event.

Not matched to upstream: none of the labels above. The re-list on a turn's end is the one recorded divergence.

Further upstream app actions are tracked on the project board.

Related Issue(s):

🔄 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)

🎯 Protocol & API Surface

  • No change to the public API surface (the SDK packages are untouched; Markdig is referenced by the HQ playground only)
  • No generated output changed
  • The pinned snapshot (spec/) is untouched
  • Nothing under external/ was hand-edited

🧪 Testing

  • HQ tests added:
    • the later title;
    • the three permission decisions;
    • dismiss;
    • stop;
    • the edit preview and the permission kind;
    • the diff line classes and the patch's trailing newline;
    • Markdown escaping;
    • folder names;
    • the form draft;
    • snippet line numbers;
    • the dock toggle;
    • the re-list on page open and on a turn's end.
      Each new test failed on the code without its change, or on a no-op, and passes now.
  • Verified against a real opencode serve (2.3.2):
    • run in a browser against an isolated server, at 1440×900 and 390×844;
    • every flow above, checked against the server: the saved always-rule, the form's dismissal, the interrupted turn, and the re-list after Stop;
    • keyboard focus and reduced motion checked by hand.

Test Environment:

  • opencode server version: 2.3.2
  • Target frameworks tested: HQ's (net11.0), plus the full gate on all targets
  • Operating systems: Windows 11

✅ Completion Gate

  • The local check in quality-gates.md passes on the head rebased onto master, and HQ's test project passes in full (120).

📚 Documentation

  • playground/hq/README.md updated: the SDK calls dock, and the re-list with its reason
  • CHANGELOG.md entry added under [Unreleased]

✅ Code Quality Checklist

  • No new analyzer warnings, and no new suppressions
  • No tests skipped or weakened
  • Branch is up to date with the target branch, no merge conflicts
  • Commit messages carry no AI-attribution trailers

🔍 Additional Notes

Breaking Changes: none. Dependencies: Markdig, for the HQ playground only.

@Blind-Striker
Blind-Striker added this pull request to the merge queue Nov 23, 2026
Merged via the queue into master with commit e53dd62 Nov 23, 2026
17 checks passed
@Blind-Striker
Blind-Striker deleted the feat/hq-redesign branch November 23, 2026 13:48
@Blind-Striker Blind-Striker mentioned this pull request Nov 24, 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.

HQ: a session created in HQ shows a blank title on the board and cannot be opened

1 participant