Skip to content

fix(browser): picking a saved view no longer reopens its menu - #960

Merged
ajslater merged 1 commit into
developfrom
fix-saved-view-menu-reopen
Sep 29, 2026
Merged

ajslater merged 1 commit into
developfrom
fix-saved-view-menu-reopen

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Problem

After you pick a saved view from the settings drawer's Load Saved View combobox, the view loads (GET …/saved-settings/<pk> → 200). Then the dropdown pops back open, with focus still in the input.

Cause

I confirmed this in a real browser with a timeline of menu state and store actions:

  1. Vuetify's closeOnSelect closes the menu, and focus stays in the combobox input.
  2. loadSavedSettings → setSettings changes settings. The component's deep browserSettings watcher sets selectedName = null.
  3. VCombobox's watch(model) then sets _search = ''. Its watch(_search) sets menu = true because isFocused && !menu, so the menu reopens.

In the timeline, the menu closes at +34 ms and reopens at +95 ms, right when setSettings finishes. Clearing selectedName by hand while the input is focused and the menu is closed reopens it too.

Fix

The watcher now blurs the combobox before it clears a picked view, meaning a model that is an object with a pk. The name still clears, and the menu stays shut.

The blur is limited to picked views because every loadBrowserPage re-sets settings.breadcrumbs, which fires the same watcher. My first try blurred on every call. It closed a menu the user had opened while a page load was still in flight. A test now covers that case.

Verification

  • Real browser (bin/dev.sh, fresh worktree DB): I saved a throwaway view and picked it by mouse (twice) and by keyboard (ArrowDown, Enter). After each pick there was no active .v-overlay--active.v-menu and the name was cleared.
  • Also checked in the browser:
    • A view whose settings match the current ones.
    • Opening the menu while a page load was in flight: it stays open.
    • Save → Overwrite dialog.
    • Merged with the trash-icon branch (identical to feat(browser): saved views can be deleted #959): a pick from its item slot keeps the menu closed, and the trash icon → Delete View dialog deleted the throwaway view (DELETE → 204).
  • Vitest (browser-saved-views-menu.test.js): the menu stays closed when a picked view's settings land, the name clears, and a page load doesn't close a menu opened mid-load. The first test fails without the fix. The third fails if the blur isn't limited to picked views.
  • make fix, make lint and make test all pass (vitest 962, pytest 1574 passed with 1 expected xfail).

🤖 Generated with Claude Code

After a saved view was picked from the settings drawer's "Load Saved
View" combobox, the view loaded but the menu popped back open with
focus still in the input.

Vuetify closes the menu on select and keeps focus in the combobox.
When the view's settings land, the component's deep settings watcher
clears the combobox model. VCombobox's model watcher then sets its
search text to '', and its search watcher opens the menu whenever the
field is focused and the menu is closed.

The watcher now blurs the combobox before clearing a picked view, so
the name still clears and the menu stays shut. It only blurs when the
model holds a picked view (an object with a pk). Every browse page
load re-sets settings.breadcrumbs, which fires the same watcher. An
unconditional blur closed a menu the user had opened while a page was
still loading.

Checked in a real browser: mouse and keyboard picks, a view whose
settings match the current ones, and opening the menu mid page load.
Also checked merged with the unpushed per-view trash icon branch: a
pick from its item slot, and its Delete View dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit 66b7040 into develop Sep 29, 2026
9 checks passed
@ajslater
ajslater deleted the fix-saved-view-menu-reopen branch October 6, 2026 20:45
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