Menus over the hover bar; composer keeps the keyboard on attach (#660, #661) #664

Closed
charles wants to merge 0 commits from fix-660-661-menu-toolbar-paste-focus into textchat
Owner

Two bugs from one forum report, fixed together.

Closes #660
Closes #661

#660: the message hover toolbar is drawn above context menus

Cause: the hover bar is an iced overlay, and iced draws overlays above every layer of a stack. #652 hid the screen's overlays (Covered) only while a modal or the quick switcher was open. Context menus and popouts are stacked layers, so the bar of the hovered message stayed on top of them and still took clicks there.
Fix: every layer that opens over the screen now draws the screen under it through widgets::covered. The screen is still drawn and keeps its widget state, but it has no overlays and the pointer is levitated. This applies to context_menu::view (message, channel, category, guild, user, DM, participant, stream, screen-share, pip, plus, add-community, thread, forum, notes, friend and blocked-user menus), popout::view_at (profile, status, crosspost card, forum popouts, panel soundboard), the expression picker, the header popouts (pins, inbox, search suggestions), the thread browser and members popouts, the call-view soundboard popout and dialog, and widgets::modal::over. Their backdrops already kept the pointer off the screen, so the only change is the overlays. The original keeps the bar drawn under its menu. Hiding it is the option the issue allows: iced cannot draw an overlay under a stacked layer.
No regression of #647 / #594: Covered keeps the screen's tree tag and children, so a menu opening keeps the tree shape (participant_menu::channel_list_keeps_its_scroll_while_the_menu_is_open passes). Card placement code is untouched (menu_placement passes).
Verified by: fluxer-ui/tests/hover_bar_layers.rs::the_bar_is_under_every_menu. It hovers a message, then opens each of: message, channel, guild, user and participant menus, status popout, profile popout, expression picker, pins popout. For each it checks that the layer opened and that nothing of the screen floats. Before the fix it failed for all nine.

#661: after an image is pasted, Enter does not send

Cause: the composer box is a column of [reply bar, rule, upload tray, input row]. The reply bar and tray were pushed only when shown. iced pairs a column's widget states by position, so when the tray appeared after a paste, the text box moved down a slot. Its state, including the keyboard focus, was rebuilt, and Enter went nowhere. The same happened when the tray went away (sent or removed), when the reply bar opened or closed, and when the character counter appeared (its stack! was conditional). Separately, a drop or the file picker never moved focus to the composer. The original does: UploadManager.tsx focusTextarea after a drop or a paste, and ChannelTextarea.tsx handleFileButtonClick focuses the textarea after the picker.
Fix: the box always has its slots (empty space() when hidden), and the counter's stack is always there, so the text box keeps its state. composer::State::sync notes when the tray grew. main::take_attachment_focus names that composer once (the channel's or the thread side panel's), and the shell focuses its editor on the snapshot, unless a modal (e.g. the refused-files alert) is open. This covers paste, drop and file picker, for the main composer and the thread/forum side-panel composer.
Verified by: new fluxer-ui/tests/composer_focus.rs (headless, widget protocol):

  • a_focused_composer_keeps_the_keyboard_while_its_box_changes: for both composers, the focused editor keeps focus across tray open/close, reply bar open/close and counter show/hide. Before the fix it failed at "the tray opens" (Nothing instead of Composer).
  • attached_files_give_their_composer_the_keyboard: for both composers and for paste, drop and file picker, starting with nothing focused, the composer is named once and focusing it gives it the keyboard. Before the fix it failed (None).

Gate

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: ==> xtask ci: all steps passed. The host has no Vulkan adapter, so the screenshot suite also ran on lavapipe (fluxer-native-shots:u2204): test result: ok. 175 passed; 0 failed. No goldens changed.

🤖 Generated with Claude Code

Two bugs from one forum report, fixed together. Closes #660 Closes #661 ## #660: the message hover toolbar is drawn above context menus **Cause:** the hover bar is an iced overlay, and iced draws overlays above every layer of a stack. #652 hid the screen's overlays (`Covered`) only while a modal or the quick switcher was open. Context menus and popouts are stacked layers, so the bar of the hovered message stayed on top of them and still took clicks there. **Fix:** every layer that opens over the screen now draws the screen under it through `widgets::covered`. The screen is still drawn and keeps its widget state, but it has no overlays and the pointer is levitated. This applies to `context_menu::view` (message, channel, category, guild, user, DM, participant, stream, screen-share, pip, plus, add-community, thread, forum, notes, friend and blocked-user menus), `popout::view_at` (profile, status, crosspost card, forum popouts, panel soundboard), the expression picker, the header popouts (pins, inbox, search suggestions), the thread browser and members popouts, the call-view soundboard popout and dialog, and `widgets::modal::over`. Their backdrops already kept the pointer off the screen, so the only change is the overlays. The original keeps the bar drawn *under* its menu. Hiding it is the option the issue allows: iced cannot draw an overlay under a stacked layer. **No regression of #647 / #594:** `Covered` keeps the screen's tree tag and children, so a menu opening keeps the tree shape (`participant_menu::channel_list_keeps_its_scroll_while_the_menu_is_open` passes). Card placement code is untouched (`menu_placement` passes). **Verified by:** `fluxer-ui/tests/hover_bar_layers.rs::the_bar_is_under_every_menu`. It hovers a message, then opens each of: message, channel, guild, user and participant menus, status popout, profile popout, expression picker, pins popout. For each it checks that the layer opened and that nothing of the screen floats. Before the fix it failed for all nine. ## #661: after an image is pasted, Enter does not send **Cause:** the composer box is a column of [reply bar, rule, upload tray, input row]. The reply bar and tray were pushed only when shown. iced pairs a column's widget states by position, so when the tray appeared after a paste, the text box moved down a slot. Its state, including the keyboard focus, was rebuilt, and Enter went nowhere. The same happened when the tray went away (sent or removed), when the reply bar opened or closed, and when the character counter appeared (its `stack!` was conditional). Separately, a drop or the file picker never moved focus to the composer. The original does: `UploadManager.tsx` `focusTextarea` after a drop or a paste, and `ChannelTextarea.tsx` `handleFileButtonClick` focuses the textarea after the picker. **Fix:** the box always has its slots (empty `space()` when hidden), and the counter's stack is always there, so the text box keeps its state. `composer::State::sync` notes when the tray grew. `main::take_attachment_focus` names that composer once (the channel's or the thread side panel's), and the shell focuses its editor on the snapshot, unless a modal (e.g. the refused-files alert) is open. This covers paste, drop and file picker, for the main composer and the thread/forum side-panel composer. **Verified by:** new `fluxer-ui/tests/composer_focus.rs` (headless, widget protocol): - `a_focused_composer_keeps_the_keyboard_while_its_box_changes`: for both composers, the focused editor keeps focus across tray open/close, reply bar open/close and counter show/hide. Before the fix it failed at "the tray opens" (`Nothing` instead of `Composer`). - `attached_files_give_their_composer_the_keyboard`: for both composers and for paste, drop and file picker, starting with nothing focused, the composer is named once and focusing it gives it the keyboard. Before the fix it failed (`None`). ## Gate `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: `==> xtask ci: all steps passed`. The host has no Vulkan adapter, so the screenshot suite also ran on lavapipe (`fluxer-native-shots:u2204`): `test result: ok. 175 passed; 0 failed`. No goldens changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#660: the message hover bar is an iced overlay, so it was drawn above every
stacked context menu and popout. context_menu::view, popout::view_at, the
expression picker, the header popouts, the thread browser/members popouts,
the soundboard popout and dialog and widgets::modal::over now draw the
screen under them through `covered` (no overlays, pointer levitated). The
covered screen keeps its widget tree, so menus keep the scroll position
(#647), and menu placement is unchanged (#594).

#661: the composer's column inserted the upload tray (and the reply bar,
and the counter's stack) before the text box, so iced rebuilt the text
box's state and dropped the keyboard focus when an image was pasted. The
slots are now always there (empty space when hidden). Files that land in
a composer's tray (paste, drop, file picker) also give that composer's text
box the keyboard, as the original's focusTextarea does; this covers the
channel's and the thread side panel's composers.

Refs #660
Refs #661

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged into textchat by hand (the merge API returns 405); the commits are in the branch.

Merged into `textchat` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-15 18:55:22 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.