Sync Open Knowledge from agents-private#535
Merged
Merged
Conversation
…#2473) * fix(open-knowledge): refresh worktree list on window focus The project switcher's worktree model was fetched once per window and only re-fetched after an in-app create, so a worktree created out-of-band (a terminal git worktree add, or a create in another OK window) stayed hidden until the app was restarted. Revalidate the cached model on window focus / tab-visible, matching the focus/visibilitychange pattern PageListContext / FileTree / GraphView already use. Wired via an injectable, ref-counted subscribeRevalidate dep so the listener attaches on first subscribe and detaches on last unsubscribe (no leak); load()'s in-flight coalescing bounds focus bursts. No IPC / bridge-contract / desktop-main change. * fix(open-knowledge): worktree flyout uses a real DropdownMenuSub submenu Migrate the ProjectSwitcher worktree 'Search worktrees' flyout from a controlled Popover to shadcn DropdownMenuSub/SubTrigger/SubContent. The whole group row is the SubTrigger, so hovering or clicking it opens the submenu with Radix safe-triangle hover and native close-on-hover-out; opening the bare project root is the flyout's pinned default entry. The search field lives inside the role=menu SubContent: the input stops keydown propagation to suppress the submenu typeahead (Escape still closes via Radix's document-level dismiss), and the list keeps manual roving with stopPropagation on Up/Down/Enter so Radix roving does not double-fire; ArrowLeft/Escape bubble so Radix closes the sub. Focus into the search input is driven by an open effect because SubContent hardcodes its own onOpenAutoFocus. Radix anchors the submenu to its trigger and would follow the row when the recents list scrolls, so ProjectSwitcher closes the open flyout on scroll. The hoisted flyout setter uses a functional update so a native sibling close cannot clobber a fresh open. Live Electron testing showed Radix submenus open on pointermove/click (the earlier no-pointerdown concern only affects drag-region title-bar triggers, which this is not). * fix(open-knowledge): restore two-target worktree row (click opens project, hover opens flyout) Reintroduce the pre-migration two-target ergonomics on top of the DropdownMenuSub flyout. Hovering a worktree-bearing project row (or ArrowRight) opens the worktree flyout as before; a direct click on the row (or Enter/Space) opens the bare project root in one click, matching a flat row. The whole row is still the single SubTrigger, so hover-anywhere keeps the flyout discoverable. Radix opens the submenu on click and on the Enter/Space/ArrowRight open keys, but its SubTrigger bails when our handler already called preventDefault, so the row's onClick and its Enter/Space keydown preventDefault and navigate to the project instead, while ArrowRight still falls through to open the flyout and ArrowLeft closes it. The Electron menu-open click fall-through guard is applied to the row-open path, as on the flat rows. Close-on-hover-out, close-on-scroll, the search field, and the flyout's keyboard roving are unchanged. * fix(open-knowledge): remove trailing branch icon from worktree search bar * fix(open-knowledge): single-source worktree count from the flyout builder * chore(open-knowledge): regenerate i18n catalogs after rebase onto main GitOrigin-RevId: a8f48c2ea13d061a392ab391b745dd2be2eafa1a
Contributor
There was a problem hiding this comment.
Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/28921384208). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copybara-translated commits from agents-private. Rebase-merge this PR so the prepared commits land directly on public main.