Pins: Jump brings the message to the middle, pin cards answer clicks (#848) #850

Closed
charles wants to merge 0 commits from fix-848-pinned-messages-clickable into textchat
Owner

Closes #848

The issue said only "pinned messages are not clickable". I drove the real main screen headlessly (iced widget protocol, software renderer, 1600 × 900, the textchat READY with a 121-message history whose 61st message is pinned and ends with the pin system message). I clicked every target the issue lists in six places and compared each against the original (ChannelPinsContent.tsx, ChannelPinsPopout.tsx, PinSystemMessage.tsx, MessageNavigator.goToMessage, ScrollManager.jumpFixTarget). Five things failed, each with its own cause.

What failed and why

  1. A jump never moved the list. This was the main bug, and it hit every jump: the popout's "Jump", the system message's "a message", and also replies, search results, notifications and the new-messages bar. The store set the jump target and lit it up, but widgets::message_list had no idea of a target. A list at its end stayed at its end, so the popout closed and nothing seemed to happen. After a jump to a pin outside the loaded history, the page around it loaded and the list sat at the end of that page. In the original, jumpFixTarget scrolls the message to the middle (layoutGetNodeAlignedScrollTop(…, 'center', MESSAGE_REVEAL_PADDING)).
    Fix: MessageList::reveal(Some((message, ticket))). When the row is in the list, it is brought to the middle once per jump: reveal_offset = centred, 8 px lower (CENTRE_ALIGNMENT_LIFT), at least 16 px from the top. This uses the list's anchor, so rows that change height while they are laid out don't move it. A scroll afterwards belongs to the user. A new jump to the same message brings it back. The ticket is the highlight timer, from the new fluxer_core::chat::navigation::reveal(app, channel). The message view passes it for the channel and for the thread panel.
  2. The content of a pin did nothing. search::results::message_preview turned every event of the row into pins::Message::Row, so links, the author or a mention, pictures, embeds and invites were inert. In the original the pin is the channel's Message component with LIST_POPOUT, and all of these work.
    Fix: message_preview takes a mapping. The pins popout sends Row { channel_id, message_id, event }, and main::update hands it, through messages::row_message, to the message view that shows the channel: the selected channel's, or the thread side panel's. Search results and the inbox keep the read-only mapping, so their behaviour does not change.
  3. No context menu on a pin. The original allows the message menu in LIST_POPOUT.
    Fix: the card goes through message_actions::row_input, and a right click opens the screen's message menu, which is drawn over the popout.
  4. A click on a blank part of the popout closed it. The backdrop mouse_area under the header popouts got every click that the popout's widgets did not take. This is the "layer that takes the click" suspect. It applied to the pins popout, the inbox and the search suggestions.
    Fix: header_popouts wraps each popout in opaque.
  5. "Jump" to a pin of a thread or forum post open in the side panel opened the thread as the main channel. search::jump sent SelectChannel(thread). The original jumps inside the panel (Navigation.threadId === channelId).
    Fix: a channel that is the panel's thread counts as shown, so only JumpToMessage is sent.

Targets, before → after

Each cell is one click on the main screen, run through main::update and the store. "Jump" passes when the pin shows in the list of the right view, is lit up, the popout is closed, and the selected channel and the panel did not change. "Thread (panel)" and "Forum post (panel)" are pins of the thread or post open in the side panel. The last column is #general's pins with a thread panel open beside it (#779).

Target Channel DM Group DM Thread (panel) Forum post (panel) Channel, thread panel open
popout Jump ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
popout blank card click ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
popout link ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
popout author ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
popout right click menu ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
popout unpin X ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅
system: a message ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅ ❌ → ✅
system: all pinned messages ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅ ✅ → ✅
popout Jump, pin not loaded ✅ → ✅ ✅ → ✅ ✅ → ✅ ❌ → ✅ ❌ → ✅ ✅ → ✅

The "pin not loaded" cells that were ✅ before were a probe artefact. The probe only checks that the pin is on screen. Before the fix, the list sat at the end of the page around the pin, and in a 900 px window the pin was on screen only near the top edge, by chance. The real test (pins_popout_jump_to_a_pin_not_loaded) also requires that the end of the page is not on screen, and that fails without the fix. The X unpinned and "all pinned messages" opened the popout before the fix as well.

Checked against the original and left as they are:

  • A click on the card's empty space is not a jump on the desktop. The original only taps to jump in the mobile layout.
  • "all pinned messages" of a thread's pin message opens the thread's pins. The original fires CHANNEL_PINS_OPEN, which opens the main header's popout for the parent channel.

Tests

  • crates/fluxer-ui/tests/pins_clicks.rs, new, headless main screen. Every target in all six places:
    • pin_system_message_links_answer
    • pins_popout_jump_brings_the_pin_into_view
    • pins_popout_pin_answers_like_its_message: blank click, link, author, right-click menu drawn over the popout, unpin X
    • pins_popout_jump_to_a_pin_not_loaded: channel and thread panel. Checks the around request, then the pin in the middle of the page.
    • message_list_reveals_a_jump_once_per_ticket: the widget alone. Middle row, scroll kept, a new ticket brings it back.
  • crates/fluxer-ui/tests/message_list.rs: reveal_offset_centres_the_row_jumped_to.
  • apps/fluxer/tests/textchat_runtime.rs: jump_to_a_pin_outside_the_loaded_history. Uses the in-process dev server (textchat). A message older than #general's first page is pinned on the server, the pins popout lists it, and the popout's Jump fetches the page around it. The message is then loaded, it is the list's reveal target and lit up, the popout is closed, and "Jump to present" applies.
  • Golden jump_to_present.png, re-rendered on lavapipe in fluxer-native-shots:u2204: the message jumped to is now lit up in the middle of the list. Before, the list sat at the end of the page and the message was at its top.

Gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passed locally ().

Edits to files shared with the shell work are small. screens/main/mod.rs gets two route arms, in_message_view and opaque in header_popouts. app.rs is untouched.

Not fixed here, filed as #849: a pin whose message is outside the loaded history gets no context menu, and its pictures don't open the lightbox (both look the message up among the loaded ones). Spoilers in a pin card can't be revealed. Search result and bookmark cards are still inert. A right click on a row of the thread side panel opens a menu that is never drawn.

🤖 Generated with Claude Code

Closes #848 The issue said only "pinned messages are not clickable". I drove the real main screen headlessly (iced widget protocol, software renderer, 1600 × 900, the `textchat` READY with a 121-message history whose 61st message is pinned and ends with the pin system message). I clicked every target the issue lists in six places and compared each against the original (`ChannelPinsContent.tsx`, `ChannelPinsPopout.tsx`, `PinSystemMessage.tsx`, `MessageNavigator.goToMessage`, `ScrollManager.jumpFixTarget`). Five things failed, each with its own cause. ## What failed and why 1. **A jump never moved the list.** This was the main bug, and it hit every jump: the popout's "Jump", the system message's "a message", and also replies, search results, notifications and the new-messages bar. The store set the jump target and lit it up, but `widgets::message_list` had no idea of a target. A list at its end stayed at its end, so the popout closed and nothing seemed to happen. After a jump to a pin outside the loaded history, the page around it loaded and the list sat at the end of that page. In the original, `jumpFixTarget` scrolls the message to the middle (`layoutGetNodeAlignedScrollTop(…, 'center', MESSAGE_REVEAL_PADDING)`). *Fix:* `MessageList::reveal(Some((message, ticket)))`. When the row is in the list, it is brought to the middle once per jump: `reveal_offset` = centred, 8 px lower (`CENTRE_ALIGNMENT_LIFT`), at least 16 px from the top. This uses the list's anchor, so rows that change height while they are laid out don't move it. A scroll afterwards belongs to the user. A new jump to the same message brings it back. The ticket is the highlight timer, from the new `fluxer_core::chat::navigation::reveal(app, channel)`. The message view passes it for the channel and for the thread panel. 2. **The content of a pin did nothing.** `search::results::message_preview` turned every event of the row into `pins::Message::Row`, so links, the author or a mention, pictures, embeds and invites were inert. In the original the pin is the channel's `Message` component with `LIST_POPOUT`, and all of these work. *Fix:* `message_preview` takes a mapping. The pins popout sends `Row { channel_id, message_id, event }`, and `main::update` hands it, through `messages::row_message`, to the message view that shows the channel: the selected channel's, or the thread side panel's. Search results and the inbox keep the read-only mapping, so their behaviour does not change. 3. **No context menu on a pin.** The original allows the message menu in `LIST_POPOUT`. *Fix:* the card goes through `message_actions::row_input`, and a right click opens the screen's message menu, which is drawn over the popout. 4. **A click on a blank part of the popout closed it.** The backdrop `mouse_area` under the header popouts got every click that the popout's widgets did not take. This is the "layer that takes the click" suspect. It applied to the pins popout, the inbox and the search suggestions. *Fix:* `header_popouts` wraps each popout in `opaque`. 5. **"Jump" to a pin of a thread or forum post open in the side panel opened the thread as the main channel.** `search::jump` sent `SelectChannel(thread)`. The original jumps inside the panel (`Navigation.threadId === channelId`). *Fix:* a channel that is the panel's thread counts as shown, so only `JumpToMessage` is sent. ## Targets, before → after Each cell is one click on the main screen, run through `main::update` and the store. "Jump" passes when the pin shows in the list of the right view, is lit up, the popout is closed, and the selected channel and the panel did not change. "Thread (panel)" and "Forum post (panel)" are pins of the thread or post open in the side panel. The last column is #general's pins with a thread panel open beside it (#779). | Target | Channel | DM | Group DM | Thread (panel) | Forum post (panel) | Channel, thread panel open | |---|---|---|---|---|---|---| | popout Jump | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | popout blank card click | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | popout link | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | popout author | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | popout right click menu | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | popout unpin X | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | | system: a message | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | ❌ → ✅ | | system: all pinned messages | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | | popout Jump, pin not loaded | ✅ → ✅ | ✅ → ✅ | ✅ → ✅ | ❌ → ✅ | ❌ → ✅ | ✅ → ✅ | The "pin not loaded" cells that were ✅ before were a probe artefact. The probe only checks that the pin is on screen. Before the fix, the list sat at the end of the page around the pin, and in a 900 px window the pin was on screen only near the top edge, by chance. The real test (`pins_popout_jump_to_a_pin_not_loaded`) also requires that the end of the page is not on screen, and that fails without the fix. The X unpinned and "all pinned messages" opened the popout before the fix as well. Checked against the original and left as they are: - A click on the card's empty space is not a jump on the desktop. The original only taps to jump in the mobile layout. - "all pinned messages" of a thread's pin message opens the thread's pins. The original fires `CHANNEL_PINS_OPEN`, which opens the main header's popout for the parent channel. ## Tests - `crates/fluxer-ui/tests/pins_clicks.rs`, new, headless main screen. Every target in all six places: - `pin_system_message_links_answer` - `pins_popout_jump_brings_the_pin_into_view` - `pins_popout_pin_answers_like_its_message`: blank click, link, author, right-click menu drawn over the popout, unpin X - `pins_popout_jump_to_a_pin_not_loaded`: channel and thread panel. Checks the `around` request, then the pin in the middle of the page. - `message_list_reveals_a_jump_once_per_ticket`: the widget alone. Middle row, scroll kept, a new ticket brings it back. - `crates/fluxer-ui/tests/message_list.rs`: `reveal_offset_centres_the_row_jumped_to`. - `apps/fluxer/tests/textchat_runtime.rs`: `jump_to_a_pin_outside_the_loaded_history`. Uses the in-process dev server (`textchat`). A message older than #general's first page is pinned on the server, the pins popout lists it, and the popout's Jump fetches the page around it. The message is then loaded, it is the list's `reveal` target and lit up, the popout is closed, and "Jump to present" applies. - Golden `jump_to_present.png`, re-rendered on lavapipe in `fluxer-native-shots:u2204`: the message jumped to is now lit up in the middle of the list. Before, the list sat at the end of the page and the message was at its top. Gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passed locally (). Edits to files shared with the `shell` work are small. `screens/main/mod.rs` gets two `route` arms, `in_message_view` and `opaque` in `header_popouts`. `app.rs` is untouched. Not fixed here, filed as #849: a pin whose message is outside the loaded history gets no context menu, and its pictures don't open the lightbox (both look the message up among the loaded ones). Spoilers in a pin card can't be revealed. Search result and bookmark cards are still inert. A right click on a row of the thread side panel opens a menu that is never drawn. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
"Pinned messages are not clickable" had five causes, found by clicking
every target on the headless main screen in a channel, a DM, a group DM,
a thread and a forum post in the side panel, and beside a thread panel:

- A jump never moved the message list: the store lit the message up but
  the list stayed where it was. `MessageList::reveal` now brings the
  message jumped to to the middle once per jump, as the original's
  `jumpFixTarget` (centred, 8 px lower, at least 16 px down), with the
  ticket from the new `chat::navigation::reveal`.
- A pin's content was inert (`message_preview` mapped every event to
  `Row`): links, the author, pictures and embeds now go to the message
  view of the pin's channel (the selected channel's or the side panel's).
- No message menu on a right click of a pin; it now opens.
- A click on a blank part of a header popout fell through to the
  backdrop and closed it; the popouts are `opaque` now.
- Jump to a pin of the thread open in the side panel opened the thread
  as the main channel; it now jumps in the panel (`goToMessage`).

The jump_to_present golden is re-rendered on lavapipe: the message
jumped to is now in the middle of the list.

Refs #848

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-18 02:25:13 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.