Skip to content

fix(desktop): avoid duplicate sidebar tabs#4326

Open
beastpu wants to merge 1 commit into
multica-ai:mainfrom
beastpu:codex/fix-4284-duplicate-tab
Open

fix(desktop): avoid duplicate sidebar tabs#4326
beastpu wants to merge 1 commit into
multica-ai:mainfrom
beastpu:codex/fix-4284-duplicate-tab

Conversation

@beastpu

@beastpu beastpu commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in AppLink mode that lets desktop tab shells open or activate an existing tab on primary clicks
  • use that mode for sidebar navigation links so clicking an active destination does not also trigger default anchor navigation
  • cover the foreground tab activation path and web fallback path with AppLink tests

Fixes #4284

Tests

  • pnpm --filter @multica/views exec vitest run navigation/app-link.test.tsx
  • pnpm --filter @multica/views typecheck
  • git diff --check

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@beastpu is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

@truffle-dev

Copy link
Copy Markdown
Contributor

Routing the primary nav through openInNewTab(href, undefined, { activate: true }) so it dedupes via openTab is the right shape.

One scoping question: the pinned sidebar items still render a plain AppLink (SortablePinItem, app-sidebar.tsx:203) and go through push, which navigates the active tab's router rather than open-or-activating by path. So clicking a pinned issue/project after switching to a different tab reproduces the same duplicate. #4284 lists "issue, or project," and pins are a primary way to open those — is leaving them on the old behavior intentional, or should they get activateTabOnClick too?

@YOMXXX

YOMXXX commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Verified the review scope: pinned issue/project rows both go through SortablePinItem, and that component was still rendering AppLink without activateTabOnClick, so pinned sidebar clicks could still route through push instead of desktop open-or-activate.

I applied the minimal fix locally:

  • SortablePinItem now renders <AppLink ... activateTabOnClick />, covering both pinned issues and pinned projects.
  • app-sidebar.test.tsx now renders the mocked SidebarMenuButton.render element and asserts loaded pinned links carry the activation flag.

Validation:

  • pnpm --filter @multica/views exec vitest run layout/app-sidebar.test.tsx navigation/app-link.test.tsx ✅ 12 tests
  • pnpm --filter @multica/views typecheck
  • pnpm --filter @multica/views lint ✅ exits 0, existing warnings only
  • git diff --check

I attempted to push the amended commit to beastpu:codex/fix-4284-duplicate-tab, but GitHub returned 403 Permission to beastpu/multica.git denied to YOMXXX despite maintainerCanModify=true.

Patch branch with the exact amended commit is available here: YOMXXX:codex/fix-4284-pinned-tabs (431dff67d).

@truffle-dev

Copy link
Copy Markdown
Contributor

Confirmed — I diffed YOMXXX:codex/fix-4284-pinned-tabs against this PR's head, and it closes exactly the gap I flagged with nothing extra. The only production change is the one-liner at SortablePinItem (app-sidebar.tsx:203):

-render={<AppLink href={href} draggable={false} />}
+render={<AppLink href={href} draggable={false} activateTabOnClick />}

so pinned issues and projects now take the same openInNewTab(href, undefined, { activate: true }) path as the rest of the nav (629/693/717) instead of falling through to push. The app-sidebar.test.tsx change is a genuine regression guard, not just coverage: the old mock silently dropped SidebarMenuButton's render element, so the pinned link was never asserted at all; it now renders that element and checks the activation flag is present.

On the 403: that's expected rather than a config problem — maintainerCanModify=true grants push to this head branch to base-repo maintainers, not to another fork's contributor, so YOMXXX can't push to beastpu's branch. The clean landing paths are either a multica-ai maintainer pulling the amended commit straight onto the branch:

git fetch https://github.com/YOMXXX/multica.git codex/fix-4284-pinned-tabs
git push https://github.com/beastpu/multica.git FETCH_HEAD:codex/fix-4284-duplicate-tab

or, since the delta is a single prod line, @beastpu just applying it directly here. Either way the scope is right and the behavior is pinned.

@YOMXXX

YOMXXX commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Opened standalone PR #4353 with the complete duplicate-tab fix including the pinned-sidebar gap: #4353

This is the same patch branch truffle-dev confirmed above, packaged as a direct PR because I cannot push to beastpu:codex/fix-4284-duplicate-tab from my fork.

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.

[Bug]: Duplicate tab

3 participants