Skip to content

feat(web): command palette (Ctrl+K), tree filter and keyboard shortcuts - #369

Merged
hanthor merged 2 commits into
tuna-os:mainfrom
hanthor:feat/command-palette-349
Oct 2, 2026
Merged

hanthor merged 2 commits into
tuna-os:mainfrom
hanthor:feat/command-palette-349

Conversation

@hanthor

@hanthor hanthor commented Sep 26, 2026

Copy link
Copy Markdown
Member

Fixes #349

What this does

  • Command palette (Ctrl+K, or ⌘K on macOS). It searches VMs, CTs, nodes, pools, views and actions, for example stop web-prod, migrate db-prod or create VM. Enter runs the top result. Items run from the palette are stored in localStorage and rank first. An exact name ranks above the verbs for that name, so typing db-prod and pressing Enter opens db-prod rather than stopping it. A pool result switches to Pool View and highlights the pool row.
  • Shortcut overlay (?), plus single-key shortcuts: c opens the console (serial terminal when there is no VNC), s starts or stops the VM, / focuses the new tree filter, and g d goes to the datacenter. These keys are ignored while focus is in a field or a VNC/serial/RDP console, so Ctrl+K still works as kill-line in a serial shell.
  • Tree filter. A new input at the top of the sidebar narrows guest rows by name in all three tree views. It is built once and kept across the 5 s poll re-render, so focus and caret survive a refresh. Escape clears it.
  • Read-only. The palette hides every action that mutates when body.read-only is set, s does nothing, and the overlay does not list s. While here, #btn-create-ct is now hidden in read-only mode too; before this only Create VM was hidden.
  • Accessibility. The palette is a native <dialog> with a combobox/listbox and aria-activedescendant. Every palette action has the same effect as the matching toolbar button.

The shortcuts and palette only call functions that already exist (select, vmAction, ctAction, the create buttons), so they add no new API surface.

Constraints (ADR-0004)

There is no build step and no new dependency. pkg/web/static/palette.js is a native ES module under the existing go:embed static, injected with helpers the same way pools.js is.

Small fix found on the way

renderPowerSchedule crashed with Cannot set properties of null when the tab changed while the schedule was loading. c makes that easy to hit, and Playwright reports it as a page error. It now returns early if its box was detached.

Acceptance: command-palette in scripts/ui-smoke.mjs

From Cluster health, the check presses Ctrl+K, types db-prod and presses Enter. It then asserts that the palette closed, that db-prod is the selected tree row and that the db-prod page is open. It also checks recency ranking, ?, / with the filter, and g d. It saves command-palette.png and shortcuts.png to ui-smoke-screenshots/, and ui-smoke.yml uploads that directory as the ui-smoke-screenshots artifact. On current main the check fails at "Ctrl+K opens the palette".

Validation

  • node --check passes on app.js, palette.js and scripts/ui-smoke.mjs.
  • Headless Chromium can't start on my machine because system libraries are missing, so the Playwright run itself happens only in the ui-smoke CI job. Instead, I loaded index.html and the real modules into jsdom against corral web --demo and ran the same flow. All steps passed with no page errors:
    • Ctrl+K opens the palette and db-prod ranks first. Enter selects db-prod in the tree and opens its page, and db-prod then ranks first as recent.
    • ? opens the overlay. / focuses the filter, db-pr leaves one guest row, and Escape restores the rest. c opens the Console tab and g d goes to the datacenter.
    • stop web returns only Stop web-prod. In read-only mode no Start, Stop, Restart, Migrate or Create result appears. A pool created through /api/folders is found and opened in Pool View.
  • GOOS=js GOARCH=wasm go build ./cmd/corral-wasm passes, so the browser demo still builds.
  • go test ./pkg/web/: only TestDemoMode_EndToEnd fails, and it fails the same way on main on this machine (no OVMF).
  • STE: the new docs/user-guide.md section adds no findings. The file scores 30 before and after on the shared linter. The repo total is still 1062 against a budget of 1054 until docs: clear every Simplified Technical English finding #356 lands, so the Prose check may fail for reasons unrelated to this PR.

— hive: backend=claude

🤖 Generated with Claude Code

🐝 Hive Agent: contributor | SHA: 7fb92a8

@hanthor-hive-agent

Copy link
Copy Markdown
Contributor

🛑 Fix loop escalated — human attention needed

This PR has stayed red on the same commit through 6 automated fix re-dispatches with no new commit pushed (1 distinct red head seen). The hive has stopped dispatching further automated fixes for it.

Failing checks: ste / Simplified Technical English, ui-smoke

Raw failure evidence (from check-run annotations):

ste / Simplified Technical English: Process completed with exit code 1.

Remove the needs-human label after addressing the root cause to return the PR to the automated fix lane.

@hanthor-hive-agent hanthor-hive-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[reviewer] recommend close: the requested command-palette capability is still absent from main, but this branch cannot be repaired in this mode because it changes .github/workflows/ui-smoke.yml, a protected path that this contributor-tier App cannot push; the branch’s ui-smoke also fails the new shortcut-overlay assertion and an existing VM-to-pool drag assertion. A human or ISSUES_PRS_MERGE agent must split/recreate the change without the workflow diff and repair the shortcut behavior; evidence: current main has no palette.js or command-palette implementation, the PR is 4 main commits behind, and CI recorded 2 smoke failures; tests: CI ui-smoke executed all checks and reported the two failures; remaining risk: the user-facing feature remains unlanded until recreated by an authorized agent.

— hive: agent=adjudicator backend=copilot model=claude-fable-5 copilot=1.0.88

@hanthor
hanthor force-pushed the feat/command-palette-349 branch from ff0ab3a to b5b1af9 Compare October 1, 2026 23:44
hanthor and others added 2 commits October 2, 2026 00:35
Ctrl/Cmd+K opens a command palette that searches VMs, CTs, nodes, pools,
views and actions ("stop web-prod", "migrate db-prod", "create VM").
Items run from it are remembered in localStorage and rank first. The
palette is a native <dialog> with a combobox/listbox, so screen readers
follow the active result.

Single-key shortcuts, ignored while typing in a field or a console:
? shortcut overlay, / focus the new tree filter, c console, s start/stop,
g d datacenter. Read-only callers are offered no action that mutates,
and the Create CT button is now hidden from them like Create VM.

The ui-smoke "command-palette" check presses Ctrl+K, types a demo VM
name, presses Enter and asserts that VM is selected; it saves
command-palette.png and shortcuts.png, which the workflow uploads.

No build step and no new dependency (ADR-0004): palette.js is a native
ES module embedded with the rest of static/.

Hive-Run: tuna-os#349
Hive-Plan: tuna-os#349 web UI command palette
Hive-Spec: tuna-os#349#acceptance-command-palette

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: James Reilly <jreilly1821@gmail.com>
After Escape the palette returns focus to an input, where ? is text and
not a shortcut, so the overlay check failed intermittently on CI.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TexZnEN3jq4jRUi8T3zZuY
Signed-off-by: hanthor <hanthor@users.noreply.github.com>
@hanthor
hanthor force-pushed the feat/command-palette-349 branch from 8925e41 to c8145f5 Compare October 2, 2026 00:37
hanthor added a commit to hanthor/corral-1 that referenced this pull request Oct 2, 2026
…ore bulk actions

Rebuilds tuna-os#374 on top of the command palette (tuna-os#369), inventory grid (tuna-os#373)
and context menus (tuna-os#385), which already cover the tree filter box, the
shared tree/grid selection set and the pool/backend menu equivalents.
What this adds:
- Shift-click selects the visible range from the anchor, Ctrl/Cmd-click
  toggles; selected rows are marked and the grid follows.
- The tree filter also matches tags and IP addresses.
- Arrow/Home/End move focus between visible tree rows.
- Bulk Snapshot, Tag and Delete next to Start/Stop/Restart.
- A bulk-select smoke check.

Fixes tuna-os#344

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TexZnEN3jq4jRUi8T3zZuY
Signed-off-by: hanthor <hanthor@users.noreply.github.com>
@hanthor
hanthor merged commit 513e6cf into tuna-os:main Oct 2, 2026
10 checks passed
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.

Web UI: command palette (Ctrl+K), global search and keyboard-shortcut overlay

1 participant