Skip to content

fix(CommandPalette): re-highlight first item after debounced results render#76

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-efd7b8ec
Jun 9, 2026
Merged

fix(CommandPalette): re-highlight first item after debounced results render#76
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-efd7b8ec

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Live sync — next commit in queue

Upstream: efd7b8ec — fix(CommandPalette): re-highlight first item after debounced results render

Immediate next commit after 007b136a (#72) in the oldest-first queue.

What & why

b24ui's CommandPalette.vue already mirrors the upstream structure — filteredGroups, filteredItems, rootRef (useTemplateRef), and rootRef.value?.highlightFirstItem() calls in navigate / navigateBack. The only gap was re-highlighting the first item after the debounced (refDebounced) results re-render. Applied the fix 1:1 with upstream:

-import { computed, ref, useTemplateRef, toRef } from 'vue'
+import { computed, ref, useTemplateRef, toRef, watch, nextTick } from 'vue'
 ...
 const rootRef = useTemplateRef('rootRef')
+
+watch(filteredGroups, () => {
+  nextTick(() => {
+    rootRef.value?.highlightFirstItem()
+  })
+})

b24ui divergence: none — framework-level (reka-ui Listbox), no icon/color/b24ui-prop adaptation. Not a breaking change.

Ledger maintenance (resolves drift from #75 §1)

Now that ports advance per-commit, this PR also starts maintaining .sync/:

sync_enabled stays false (automation Phase 2 / #67 not live yet).

Validation (linux verify script; windows .ps1 below in chat)

  • dev:prepare · ✅ eslint · ✅ typecheck
  • ✅ CommandPalette spec (86 passed) · ✅ full pnpm exec vitest run (no -u) 4886 passed | 6 skipped
  • Snapshots unchanged by construction: the watch is non-immediate, so it does not fire on initial mount.

https://claude.ai/code/session_01Qz7EXMncvEGiCj4WbmYgJo


Generated by Claude Code

…render

Port of nuxt/ui efd7b8ec. b24ui's CommandPalette already mirrors the
upstream structure (filteredGroups/filteredItems/rootRef and
highlightFirstItem from navigate/navigateBack); the only gap was the
re-highlight after the debounced (refDebounced) results re-render.

- import `watch, nextTick`
- watch(filteredGroups) -> nextTick -> rootRef.value?.highlightFirstItem()

Also maintain the sync ledger going forward (resolves the drift noted in
the project assessment / #75): set .sync/nuxt-ui.json cursor to efd7b8ec,
backfill `processed` for #68-#72, add .sync/log/<sha>.md for this port.
@IgorShevchik IgorShevchik merged commit d9debe3 into main Jun 9, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-efd7b8ec branch June 9, 2026 08:01
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.

2 participants