Composer: draft echo race, typing during inline edit, update ignores ComposerOptions #400

Open
opened 2026-11-13 02:45:03 +00:00 by charles · 0 comments
Owner

Deferred from the review of PR #391 (Text chat 25, rich composer), findings 1–3. None is blocking; seen on branch textchat-25-ui-composer (ef9f693).

  1. screens/main/composer/mod.rs, Mirror::sync: after expect_change() (Send, popup pick, @everyone confirm) any snapshot that differs from the box replaces it, and sent is cleared first. If the runtime is behind (store "hel", box "hello"), Enter is pressed, a late "hel" snapshot overwrites the box, and the user types "x" before the clearing snapshot arrives, ComposerEdited("helx") lands after the send and the next draft starts with stale text. Suggested: keep sent across expect_change and treat a text found in sent as an echo even while expecting.
  2. app.rs printable key / State::type_text, and update for TextArea(Edit) while an inline edit is open: text typed into the main box during an edit is not told to the store until the next change; the key handler focuses EDITOR_ID instead of the edit box. Switching channel or pressing Enter without another keystroke drops those characters.
  3. composer::update rebuilds the view with ComposerOptions::default() and always uses channel's draft, so send_on_enter / draft_key / slash_commands are not honoured on the update path. Text chat 44/46 need update to take the options (or the ComposerView).
Deferred from the review of PR #391 (Text chat 25, rich composer), findings 1–3. None is blocking; seen on branch `textchat-25-ui-composer` (ef9f693). 1. `screens/main/composer/mod.rs`, `Mirror::sync`: after `expect_change()` (Send, popup pick, `@everyone` confirm) any snapshot that differs from the box replaces it, and `sent` is cleared first. If the runtime is behind (store "hel", box "hello"), Enter is pressed, a late "hel" snapshot overwrites the box, and the user types "x" before the clearing snapshot arrives, `ComposerEdited("helx")` lands after the send and the next draft starts with stale text. Suggested: keep `sent` across `expect_change` and treat a text found in `sent` as an echo even while expecting. 2. `app.rs` printable key / `State::type_text`, and `update` for `TextArea(Edit)` while an inline edit is open: text typed into the main box during an edit is not told to the store until the next change; the key handler focuses `EDITOR_ID` instead of the edit box. Switching channel or pressing Enter without another keystroke drops those characters. 3. `composer::update` rebuilds the view with `ComposerOptions::default()` and always uses `channel`'s draft, so `send_on_enter` / `draft_key` / `slash_commands` are not honoured on the update path. Text chat 44/46 need `update` to take the options (or the `ComposerView`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#400
No description provided.