Skip to content

fix(ui): pick nothing by default when taking over hooks from targets - #935

Merged
runkids merged 2 commits into
mainfrom
runkids/ui-hooks-import-ux
Nov 16, 2026
Merged

runkids merged 2 commits into
mainfrom
runkids/ui-hooks-import-ux

Conversation

@runkids

@runkids runkids commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

None. Maintainer feedback on the dashboard's hooks import flow.

What changes

Dashboard only (ui/), plus one sentence in the hooks reference and its four translations.

  1. Nothing is selected by default. The dialog that lists a target's unmanaged hooks is also where a hook is edited or removed in place, but it opened with every hook ticked, so managing removals could import the rest by accident. It now opens at 0 / N, the footer says nothing is picked, and the import button is disabled until something is ticked. Hooks read from pasted text are not pre-selected either.
  2. Entry points renamed. The button and dialog title are now "Hooks in targets" (was "Import" / "Import hooks"), the page note is "Not managed yet" with a "Review" button (was "Ready to import" / "Review and import"). The "Import N" button inside the dialog is unchanged. All 11 locales updated.
  3. Review step has one scroll area. The dialog body is the only thing that scrolls; header and footer stay pinned. Removed and edited hook names are listed once as tags, a file card shows a count per action instead of one row per hook, and the diff opens on request with no height cap.
  4. Add/Edit hook uses the same command cards as editing a hook in a target: collapsible, with a multi-line editor that can be expanded. A collapsed card with a missing field shows a marker.
  5. Missing OpenCode CLI has a readable message when its hooks are read, instead of the raw exec: "opencode": executable file not found in $PATH. The same failure shown as a plan warning (sync preview, Sync page, target hooks) gets a matching message.

Behaviour changes to be aware of

  • HooksPreview is shared, so the sync, save, remove and restore previews also lose their inner scroll areas and gain the show/hide diff toggle. Their diffs still start open.
  • In the Add/Edit hook dialog, the variable buttons now append to the command instead of inserting at the cursor, and "Add command" starts the new command on the previous command's event. Both match the existing behaviour of the cards in the import editor.

Not covered

  • No rendered tests were added for the review layout, the diff toggle or the collapsed-card marker; they were checked by hand in a browser (Playful theme, zh-TW, 1280×900). Clean theme and dark mode were not inspected.

Checks

Run in a devcontainer on this branch:

  • pnpm exec vitest run in ui/: 112 files, 960 tests passed
  • pnpm exec tsc -b: clean
  • pnpm run lint: 0 errors (53 existing warnings)
  • python3 scripts/ai-context.py check: ok

Not run: make check (no Go changes), the website build, E2E runbooks. pnpm run build passed before the last two rounds of edits and was not rerun after them.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — UI tests pass; make check was not run, see Checks
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR — four related changes to the same hooks import flow, listed above

The hooks import dialog is also where a hook is edited or removed in its
target file without importing it, but it opened with every hook ticked,
so managing removals could import the rest by accident. It now opens
with nothing selected, and its entry points are named for what they
show ("Hooks in targets", "Not managed yet") instead of "Import".

The review step stacked three scroll areas (dialog body, file list,
diff) and listed each removed hook three times. The dialog body is now
the only thing that scrolls, hook names are listed once, a file card
shows a count per action, and its diff opens on request. The other hook
previews share the component: their diffs still start open but lose the
inner scroll and gain the same toggle.

Adding or editing a hook now uses the same command cards as editing one
in a target: collapsible, with a multi-line editor that can be expanded.
A collapsed card with a missing field is marked. The variable buttons
append to the command there instead of inserting at the cursor.

A missing OpenCode CLI showed the raw exec error when reading its hooks;
it now says the command was not found and what to do.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T19:41:32.201288Z 298f14b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The sync preview, Sync page and target hooks views show the same
failure as a plan warning, wrapped as "target X: detect OpenCode API
...; its hook bindings are skipped". That form still put the raw exec
error in parentheses. It now says the command was not found, that the
bindings are skipped, and what to do. Other detection failures keep
the existing message with the detail.
@runkids

runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids

runkids commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 298f14baee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@runkids
runkids merged commit 0f816a3 into main Nov 16, 2026
9 checks passed
@runkids
runkids deleted the runkids/ui-hooks-import-ux branch November 16, 2026 19:43
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