[aidan] ux/large-text-paste: make pasted-text cards editable with autosave#119
Conversation
|
Substance review (separate from the CI reds): right idea — editable pastes with autosave is real UX, and the in-memory draft Map means the per-keystroke save is cheap. Two things before green-light: (1) the controlled MUI TextField re-renders the full string on every keystroke, and large pastes are this feature's whole point — a 300KB paste will type like molasses; consider an uncontrolled textarea (defaultValue + onChange) or debouncing the controlled value. (2) the useEffect syncing draft from getPasteContent keys only on pasteId — fine today, but if content can refresh under the same id the draft goes stale; cheap to also key on the fetched value. Perf point (1) is the one I'd insist on. |
|
Landed in eric/dev for the 1.5.5 cut (see the merge commits + follow-up fixes on eric/dev); closing as merged-via-branch. |
2b80624: Makes pasted-text cards in the chat input editable via an autosaving textarea instead of a read-only preview, since users previously had to delete and re-paste the whole card just to fix a typo. Also fixes a bug where cards restored from an unsent draft (e.g. after closing and reopening the composer) lost their click/remove listeners because innerHTML restore drops JS event handlers. Typechecked clean and manually verified end-to-end in the running app via CDP (paste, hover, edit, autosave, and survives composer remount).