feat(pinned): re-render bubble on pin/unpin so hover menu flips immediately #68
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/pin-message"
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?
Previously the pin/unpin HTTP response returned only the OOB strip fragment, leaving the acting tab's message hover menu stuck on the stale label (Pin after pinning, Unpin after unpinning) until the next full page render. The WS broadcast to other tabs had the same gap.
Extract the repeated MessageView assembly into a shared
load_message_view_for_viewerhelper inroutes/mod.rs. Both the HTTP handlers (post_pin,delete_pin) and the WSrender_pin_eventfunction now return the re-rendered bubble concatenated with the OOB strip fragment. The bubble usesoob=falsein HTTP responses (HTMX uses the button'shx-target="#msg-{id}") andoob=truein WS broadcasts (silent no-op if the element is not in the DOM). Update the pin/unpin buttons inmessage.htmlto sethx-targetandhx-swap="outerHTML", and add assertions in the route tests to verify the bubble and flipped button are present in the response.Previously the pin/unpin HTTP response returned only the OOB strip fragment, leaving the acting tab's message hover menu stuck on the stale label (Pin after pinning, Unpin after unpinning) until the next full page render. The WS broadcast to other tabs had the same gap. Extract the repeated MessageView assembly into a shared `load_message_view_for_viewer` helper in `routes/mod.rs`. Both the HTTP handlers (`post_pin`, `delete_pin`) and the WS `render_pin_event` function now return the re-rendered bubble concatenated with the OOB strip fragment. The bubble uses `oob=false` in HTTP responses (HTMX uses the button's `hx-target="#msg-{id}"`) and `oob=true` in WS broadcasts (silent no-op if the element is not in the DOM). Update the pin/unpin buttons in `message.html` to set `hx-target` and `hx-swap="outerHTML"`, and add assertions in the route tests to verify the bubble and flipped button are present in the response.