mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7591] [MERGED] fix(chat): keep the expanded editor open when a Grammarly suggestion is applied #7820
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7820
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7591
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/expanded-editor-grammarly📝 Commits (2)
c0eecdefix(chat): keep the expanded editor open when a Grammarly suggestion is applied64ed7f4fix(chat): keep Edit Summaries and preset value editors open on Escape in a Grammarly card📊 Changes
7 files changed (+282 additions, -4 deletions)
View changed files
➕
e2e/extension-ui-presses.e2e.ts(+244 -0)📝
packages/client/src/components/chat/SummariesEditorModal.tsx(+3 -1)📝
packages/client/src/components/presets/PresetVariablesEditor.tsx(+3 -1)📝
packages/client/src/components/ui/ExpandedTextarea.tsx(+3 -1)📝
packages/client/src/components/ui/FloatingWindow.tsx(+3 -0)📝
packages/client/src/components/ui/MacroTextarea.tsx(+3 -1)📝
packages/client/src/lib/chat-floating-ui-events.ts(+23 -0)📄 Description
Linked issue
No linked issue: reported by the maintainer on 2026-10-14.
Why this change
<grammarly-popups>custom element with an open shadow root that it appends to<html>. This was checked against the source of the installed Grammarly Chrome extension (14.1329.0). Clicking "accept" there looked like a press elsewhere to the shared floating-window handler (FloatingWindow.tsx, the outsidepointerdownlistener that callsrequestClose("outside-pointer")). That closed the unpinned Chat Settings window and unmounted the editor inside it. A pinned window stayed open, which confirmed this handler as the cause.<dialog>instead only behind one of its experiment flags. The app uses no<dialog>elements, so that case can't come up here.What changed
isBrowserExtensionUi(target)inlib/chat-floating-ui-events.ts. It steps out of shadow roots, then climbs to the element added directly to<body>or<html>. It returns true for anything added to<html>and for a custom element (a tag name with a hyphen) under<body>. The app's root and portals are plain elements, so they never match. No list of extension names is needed. These handlers ignore those targets:FloatingWindow's outside-press handler;ExpandedMacroEditor(MacroTextarea.tsx),ExpandedTextarea,SummariesEditorModalandExpandedEditorModal(PresetVariablesEditor.tsx).ponytail:note records the known limit: an extension that hosts its UI in a plain element under<body>still counts as outside.e2e/extension-ui-presses.e2e.ts(desktop Chromium). It injects a<grammarly-popups>card with an open shadow root and clicks its accept button with real pointer events. That applies the fix throughexecCommand("insertText").<body>and then under<html>. The spec also moves focus into the card, sends a windowblur(a smoke check only, since a syntheticblurfires nofocusouton the field) and presses Escape in the card. It checks that the editor and Chat Settings stay open, that Escape in the editor still closes it, that the saved summary has both fixes, and that a click on the chat still closes Chat Settings.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agents:
playwright test --project=desktop-chromium e2e/extension-ui-presses.e2e.tswith the fixes removed:stagingcode. After the first accept, the expanded editor was gone.staging.<body>closed the editor and Chat Settings, and so did a click on the card under<html>. With the window pinned, nothing closed.blurand a syntheticinputevent closed nothing. Escape inside the card closed the expanded editor.pnpm localization:check: passed. No new strings.pnpm check: passed.chat-settings-window,drawer-popout,prompt-field-font,semantic-recall-controlsandsummary-controls. 36 passed, 4 skipped (the skips are project-gated). An earlier run of the first round also coveredchat-control-windows,tracker-windowand the matchingcore-flowscases.pnpm smoke:ui: 7 passed.coderabbit review --agent --committed --base-commit <merge-base>): review completed with 0 findings on both rounds.Manual verification notes
Manual verification:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No visual change. The regression spec covers the behaviour.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.