fix(release): source-build pg tools + Cmd+K palette select/navigation

CI (release.yml) — pg-tools bundle step failed on Linux/macOS with
'catalog/pg_*_d.h not found': building src/bin/pg_dump directly raced its
generated-headers prerequisite under -j. Fix: run 'make -C src/backend
generated-headers' serially first. Also drop the unrecognized --disable-shared
flag (PG16 client tools link shared libpq) and bundle libpq alongside the
tools — @loader_path rewrite via install_name_tool on macOS, $ORIGIN rpath
via patchelf on Linux — plus a 'tools run' sanity check so a broken bundle
fails the step before release. Windows (EDB download + libpq.dll) already
passed. Verified locally: all 3 tools run from the bundled dir.

Cmd+K palette — selecting a result did nothing visible:
- non-table results set selectedObjectType but never switched the view (the
  Objects page only mounts when DbViewerScreen's local currentView ===
  'objects'), so nothing happened. Added a store 'requestedView' field that
  DbViewerScreen consumes and clears; the palette now requests the right view
  ('objects' for functions/triggers/sequences/enums/etc., 'db-viewer' for
  tables/views/matviews before openTab) so the tab or Objects list actually
  appears.
- Added keyboard navigation: ↑/↓ move the highlight (wrapping), Enter picks,
  Esc closes. scrollIntoView guarded with optional call so jsdom tests don't
  crash on the ref callback.
- Tests: palette select now asserts requestedView; new ArrowDown/Enter,
  ArrowUp-wrap, empty-Enter cases; store test for requestedView setter.
This commit is contained in:
2026-08-05 21:11:10 +08:00
parent d84c70a1be
commit cebd548568
6 changed files with 191 additions and 34 deletions
@@ -188,6 +188,16 @@ export function DbViewerScreen({
const setSmartSortApplied = useDbViewerStore((s) => s.setSmartSortApplied);
const setObjectSearchOpen = useDbViewerStore((s) => s.setObjectSearchOpen);
const requestedView = useDbViewerStore((s) => s.requestedView);
// Consume the search palette's navigation request: switch the local
// currentView state to the requested view, then clear it so a second
// request for the same view still fires.
useEffect(() => {
if (!requestedView) return;
setCurrentView(requestedView);
useDbViewerStore.getState().setRequestedView(null);
}, [requestedView]);
// Sync settings defaults to store
useEffect(() => {