-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
fix: bi-directional links show button overlapping with database view settings #14710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
37d5684
745df1c
2e75701
7c90206
3afef2f
7ac7c99
38482f4
aa5aaf1
ce188b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,13 @@ export class DataViewHeaderToolsViewOptions extends WidgetBase { | |
| }; | ||
|
|
||
| openMoreAction = (target: PopupTarget) => { | ||
| popViewOptions(target, this.dataViewLogic); | ||
| popViewOptions( | ||
| { | ||
| ...target, | ||
| root: document.body, | ||
| }, | ||
| this.dataViewLogic | ||
| ); | ||
|
Comment on lines
+77
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Inspect PopupTarget construction and popup target helper implementation.
rg -n -C3 "popupTargetFromElement|type PopupTarget" --type ts --type js
# 2) Confirm popup root is used as the modal container.
rg -n -C3 "createModal\\(target\\.root\\)|target\\.root" --type ts --type js blocksuite/affine/components/src/context-menu
# 3) Find other places overriding root to document.body (to assess consistency/risk).
rg -n -C2 "root:\\s*document\\.body" --type ts --type jsRepository: toeverything/AFFiNE Length of output: 50376 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find PopupTarget type definition
echo "=== PopupTarget Type Definition ==="
rg -n "type PopupTarget|interface PopupTarget" --type ts --type js -A 5
# Find popupTargetFromElement implementation
echo -e "\n=== popupTargetFromElement Implementation ==="
rg -n "export.*popupTargetFromElement|function popupTargetFromElement" --type ts --type js -A 10 | head -60
# Look for where root: document.body pattern appears
echo -e "\n=== root: document.body Overrides ==="
rg -n "root:\s*document\.body" --type ts --type js
# Check the specific file context around lines 77-83
echo -e "\n=== File Context around lines 70-85 ==="
sed -n '70,85p' blocksuite/affine/data-view/src/widget-presets/tools/presets/view-options/view-options.tsRepository: toeverything/AFFiNE Length of output: 14173 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Get the complete popupTargetFromElement implementation
echo "=== Complete popupTargetFromElement Implementation ==="
sed -n '407,430p' blocksuite/affine/components/src/context-menu/menu-renderer.ts
# Check what popViewOptions does with the root parameter
echo -e "\n=== popViewOptions Implementation/Usage ==="
rg -n "popViewOptions|export.*popViewOptions" --type ts --type js -A 15 | head -80
# Check if there are any comments or tests explaining the root behavior
echo -e "\n=== Context around PopupTarget root usage ==="
rg -n "\.root" blocksuite/affine/components/src/context-menu/menu-renderer.ts -B 2 -A 2 | head -40Repository: toeverything/AFFiNE Length of output: 5555 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find getDefaultModalRoot implementation
echo "=== getDefaultModalRoot Implementation ==="
rg -n "getDefaultModalRoot|function getDefaultModalRoot|export.*getDefaultModalRoot" --type ts --type js -A 20 | head -60
# Check if there are shadow DOM or scoped root contexts in use
echo -e "\n=== Shadow DOM or scoped root patterns ==="
rg -n "shadowRoot|getRootNode" blocksuite/affine/components/src/context-menu --type ts --type js | head -20Repository: toeverything/AFFiNE Length of output: 4138 Override modal container carefully to preserve scoped root logic. Line 80 hardcodes the popup container to the global Proposed change popViewOptions(
{
...target,
- root: document.body,
+ root: target.root.ownerDocument?.body ?? target.root,
},
this.dataViewLogic
);🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current behavior is intentionally narrow: only the data-view “View settings” popup flow overrides root to document.body. We do that because the default scoped root resolves to the nearest editor-host, and editor-host creates an isolated stacking context, which is the reason this menu can render underneath sibling UI like the bi-directional links “Show” button. Re-deriving the root from getDefaultModalRoot(...) here would usually put the popup back into editor-host and reintroduce the original layering bug.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I've noted this for future reviews. ( ˘▽˘)っ♨ ✏️ Learnings added
|
||
| }; | ||
|
|
||
| override render() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the data-view “View settings” popup layering issue where the bi-directional links “Show” button could appear above the menu. The root cause was that this popup was being mounted inside the local editor stacking context, so its z-index could still lose to sibling UI. This change only lifts the view-settings popup flow to document.body, which keeps the fix scoped to this menu family instead of changing popup behavior globally.