Skip to content

fix(desktop): keep workspace activity popover anchored to its button - #9165

Open
harshithmullapudi wants to merge 1 commit into
mainfrom
superset/super-3055-keep-pull-requests-modal-anch-14e581d1
Open

harshithmullapudi wants to merge 1 commit into
mainfrom
superset/super-3055-keep-pull-requests-modal-anch-14e581d1

Conversation

@harshithmullapudi

@harshithmullapudi harshithmullapudi commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Links

Summary

  • The workspace activity popover (pull requests / pages) now stays anchored to its trigger button when the window or the split layout resizes, instead of staying at its old screen position.
  • Removes the zero-height anchor span and its activityPanelStore state, which only existed to anchor this popover.

Why / Context

In floating mode (center area too narrow to dock the panel), the popover was anchored through a virtualRef to an invisible h-0 span that ActivityPanelAside put in the top-right pane, not to the button. floating-ui's layout-shift observer returns early for references with no width or height, and the span never changes size, so its ResizeObserver never fires either. The window resize event did fire, but before the split layout settled. After that nothing repositioned the popover, so it drifted 174px off the button on a 1920→1500 resize and overshot by 162px on the way back (numbers on the page above).

How It Works

  • WorkspaceActivityMenu: the trigger button is wrapped in <PopoverAnchor asChild>, so Radix/floating-ui track the real button. sideOffset goes back to the default 4px, because the popover now sits under the button rather than under an offset span.
  • ActivityPanelAside, activityPanelStore, constants: drop the anchor span, anchorNodes / setAnchorNode / clearAnchorNode, and PANEL_TOP_GAP_PX.

Docked mode (panel in the pane aside) is untouched.

Manual QA Checklist

Desktop dev build in this workspace, driven over CDP with real mouse input and X11 window resizes. Same script before and after:

  • Workspace with a terminal and the right pane open → open the popover. It opens 4px under the button, right edges aligned (before: 88px lower, under the pane header).
  • Resize the window 1920→1500px with the popover open. It follows the button (offset 0; before: 174px).
  • Resize 1500→1920px. Still flush (before: −162px).
  • Rapid oscillation 1400/1800/1300/1920/1500/1700/1920px at 250ms. Ends flush, and no console.error fired.
  • Clicking the button again closes the popover; the tooltip still shows on hover.
  • Right pane closed at 1920px → the docked panel still renders in the aside.
  • Deterministic repro with no window resize: popover open, then Ctrl+Shift+B (toggle workspace sidebar). Base (parent commit's files, hot-reloaded): button moves to x=1165 and the popover stays at x=1250, 85px off. Fix: offset 0, and it stays 0 when the sidebar is shown again. The window-resize drift depends on timing (it needs the split layout to re-settle after the resize event), but any layout change that fires no resize event reproduces it every time. The reported recording shows this case: the right pane closes while the popover is open.

Design Decisions

  • Anchor to the button, not the docked card's spot. feat(desktop): subagents, background work and PRs in the top bar #8975 put the anchor span where the docked card sits on purpose, so the floating popover opened in the same place. This PR drops that: the floating card now opens under its button and covers the pane's agent-launcher row while open. SUPER-3055 asks for this ("anchored on the button / react to resizes"). If the docked-spot placement should stay, the alternative is a non-zero-size span (e.g. h-px) that floating-ui can track. That alternative was not tested.

Testing

  • bun run typecheck (apps/desktop)
  • bunx biome check on the changed files
  • bun test .../WorkspaceActivityMenu (14 pass)

No unit test added. The bug lives in floating-ui's live layout tracking, which bun's DOM-less tests can't exercise, so the CDP repro is the regression check.


Summary by cubic

Fixes the workspace activity popover drifting up to ~174px when the window or split layout resizes, by anchoring it to the trigger button instead of an invisible zero-height span.

  • The popover previously anchored to a h-0 span in the right pane via virtualRef; floating-ui skips zero-size references, so the popover kept stale coordinates after the first resize.
  • The trigger button is now wrapped in PopoverAnchor asChild, and the popover sits 4px below it via the default sideOffset.
  • Removed the anchor span, the anchorNodes store state, and PANEL_TOP_GAP_PX; docked panel mode is unchanged.

Written for commit 85d7371. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Updates
    • The workspace activity menu is now anchored directly to its trigger button. Its displayed content and behavior remain unchanged, while the explicit spacing offset has been removed.
    • The activity panel’s attachment and visibility behavior remain unchanged.

The floating activity popover anchored to a zero-height span in the
top-right pane instead of the trigger. floating-ui's layout-shift
observer skips zero-size references, so when the window or split layout
resized the popover stayed at its old coordinates.

Anchor the popover to the trigger button with PopoverAnchor asChild and
remove the span and its store state, which nothing else used.

Fixes SUPER-3055
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6ee8707-84a7-4d96-99e9-22a461696b8a
Commits

Reviewing files that changed from the base of the PR and between 94dc775 and 85d7371.

Files selected for processing: 4
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/WorkspaceActivityMenu.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/components/ActivityPanelAside/ActivityPanelAside.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/constants.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/stores/activityPanelStore/activityPanelStore.ts
Files with no reviewable changes: 3
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/constants.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/components/ActivityPanelAside/ActivityPanelAside.tsx
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/stores/activityPanelStore/activityPanelStore.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The activity menu popover now anchors to its trigger button. The activity panel no longer creates or stores per-workspace anchor nodes, and the related gap constant was removed. The trigger content and aside attachment and visibility behavior remain unchanged.

Changes: Activity menu anchoring

Layer / File(s) Summary
Replace workspace anchor with trigger anchor
apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/components/WorkspaceActivityMenu/WorkspaceActivityMenu.tsx, .../components/ActivityPanelAside/ActivityPanelAside.tsx, .../constants.ts, .../stores/activityPanelStore/activityPanelStore.ts
The activity menu popover uses its trigger button as its anchor. The aside no longer renders or registers a separate anchor, and the store no longer maintains per-workspace anchor nodes. The PANEL_TOP_GAP_PX constant and explicit sideOffset={0} prop were removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: avipeltz

Merge Risk: Minimal · up to 85d73

The change has no confirmed merge-blocking risk and is ready to merge with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: keeping the workspace activity popover anchored to its trigger button.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The pull request description is complete and relevant. It explains what changed, why the change was needed, implementation details, affected modes, manual QA results, automated checks, and the linked …
Full details: Description check

Explanation

The pull request description is complete and relevant. It explains what changed, why the change was needed, implementation details, affected modes, manual QA results, automated checks, and the linked issue. It does not include the repository checklist section, but the required information is otherwise covered.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues were found.

Summary

The floating workspace activity popover now anchors to its button instead of an invisible span.

  • The floating activity popover follows its button when the layout changes.

Reviews (1) · Last reviewed commit: "fix(desktop): keep workspace activity po..." · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ✅ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

Copy link
Copy Markdown
Contributor

Review: looks good. The change is small and removes code. At 85d7371a, the popover stayed flush with the button in the desktop app through every resize (offset 0 at 1920/1500/1300 px and through a 250 ms oscillation, no console.error). Docked mode, the toggle and the tooltip all still work. CI is green.

Findings:

  • Minor, design: WorkspaceActivityMenu.tsx:735 / ActivityPanelAside.tsx:62. feat(desktop): subagents, background work and PRs in the top bar #8975 put the anchor span at the docked card's spot on purpose ("so the popover opens in exactly the same place"). The floating card now opens under the button and covers the pane's launcher row. Fine if that's the intended design; otherwise keep a non-zero-size span (e.g. h-px). I did not test that alternative.
  • Info: I could not reproduce the 174px drift at base in this sandbox. Base kept a constant −6/+89 offset through single, oscillating and stepped X11 resizes. The exact repro steps would help.

Full report with before/after screenshots and videos: https://app.superset.sh/page/pr-9165-review-activity-popover-anchor-6jlsgm

This branch was previously deployed

1 inactive deployment
preview — 85d7371a Deployed Oct 30, 2026 by harshithmullapudi via Deploy Marketing #13380
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