Desktop: Make input routing aware of floating menus - #4498
Conversation
152cb54 to
f033e5f
Compare
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
f033e5f to
17e6ba1
Compare
17e6ba1 to
0001d63
Compare
0001d63 to
122b28d
Compare
122b28d to
ee509aa
Compare
ee509aa to
08c89a9
Compare
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
0df9ae6 to
08c89a9
Compare
There was a problem hiding this comment.
2 issues found across 7 files (changes from recent commits).
Confidence score: 3/5
- In
frontend/src/components/panels/Document.svelte, removing thereportFloatingMenuClose(textboxId)cleanup can leavetextToolInteractiveInputElementpermanently set when the Document panel is destroyed, affecting later text-input behavior — restore equivalent cleanup on destruction. - In
frontend/src/components/layout/FloatingMenu.svelte, the destruction callback can re-enable native direct input afterdestroyInputManager()has disabled it, leaving editor input in an inconsistent state — guard menu-state updates during manager teardown.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/panels/Document.svelte">
<violation number="1">
P2: Removing the `reportFloatingMenuClose(textboxId)` call from `onDestroy` leaves `textToolInteractiveInputElement` in `src/utility-functions/input.ts` permanently set when the Document panel is destroyed while its text box is open. That module-level state is only cleared by the `modifyinputfield` event that `displayRemoveEditableTextbox()` dispatches; there is no destroy-time path anymore. By contrast the removed code cleaned up on destroy. Result: `updateDirectInput` keeps `directInputEnabled = false` (desktop direct input stays off) and `onPointerUp`/`onPointerDown` keep treating clicks as text commits for any subsequently opened document. Dispatch `modifyinputfield` with `undefined` (or clear `textToolInteractiveInputElement`) in Document.svelte's `onDestroy`.</violation>
</file>
<file name="frontend/src/components/layout/FloatingMenu.svelte">
<violation number="1" location="frontend/src/components/layout/FloatingMenu.svelte:167">
P2: When the editor is torn down with a floating menu mounted, this `onDestroy` callback can re-enable native direct input after `destroyInputManager()` has disabled it. Guard menu-state updates during manager teardown or perform the final disable after all child components are destroyed.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| }); | ||
|
|
||
| onDestroy(() => { | ||
| onFloatingMenuOpenChange(menuId, false, editor); |
There was a problem hiding this comment.
P2: When the editor is torn down with a floating menu mounted, this onDestroy callback can re-enable native direct input after destroyInputManager() has disabled it. Guard menu-state updates during manager teardown or perform the final disable after all child components are destroyed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At frontend/src/components/layout/FloatingMenu.svelte, line 167:
<comment>When the editor is torn down with a floating menu mounted, this `onDestroy` callback can re-enable native direct input after `destroyInputManager()` has disabled it. Guard menu-state updates during manager teardown or perform the final disable after all child components are destroyed.</comment>
<file context>
@@ -163,7 +164,7 @@
onDestroy(() => {
- reportFloatingMenuClose(menuId);
+ onFloatingMenuOpenChange(menuId, false, editor);
containerResizeObserver.disconnect();
dialogResizeObserver?.disconnect();
</file context>
1ccfcf7 to
8818ec2
Compare
|
|
||
| #[derive(Clone, Copy, PartialEq)] | ||
| enum Route { | ||
| Ui, |
8818ec2 to
5cfc0bf
Compare
No description provided.