User feedback on the previous DRAWER-EDITABLE pass: the "Edit / Save /
Cancel" labeled buttons were too heavy. The reference design is the
Notion / Linear inline-edit pattern — resting state shows only the
preview text, a small pencil reveals on hover, click opens a textarea
with compact icon-only ✓ / ✕ controls beneath.
Drawer refactor:
- `activationMode="none"` + `submitMode="none"` — only the explicit
triggers drive state. Removes accidental commits on blur / Enter
(Enter must be a newline in a textarea anyway).
- `Editable.Input` swapped to a textarea via the `child` snippet:
`{#snippet child({ props })}<textarea {...props} rows={2}></textarea>`.
ALT and CAPTION can run long; a single-line input was wrong.
- `EditTrigger` / `SubmitTrigger` / `CancelTrigger` now hold only an
icon (Pencil / Check / X) with `decorative` flag + `aria-label` on
the trigger button for screen readers.
- Wrapper attribute `data-words-drawer-editable` scopes all the
custom CSS to these two Editables — other Editable instances in
the app keep the canonical wrapper look.
CSS (`words.css`, scoped to `[data-editable][data-words-drawer-editable]`):
- Pencil hidden by default (opacity 0); revealed on `:hover` /
`:focus-within` of the editable row.
- Edit mode flips layout to column: textarea fills the row, the
Control bar sits beneath, right-aligned.
- Textarea has a real border + focus ring (was inheriting the ghost
variant's transparent treatment, looked invisible against the drawer).
- Submit chip is filled accent (✓ stands out), Cancel chip is
outlined neutral. Both 28×28 square.
- Preview placeholder ("Describe the image…") is italic + muted.
Verified in browser:
- Hover over ALT row → pencil appears at the right (opacity 0.7)
- Click pencil → textarea visible with current value preselected
- Below: purple ✓ + outlined ✕
- Type new value → click ✓ → `<img alt="...">` in the editor and the
drawer preview both update; mode returns to preview.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
active-uix
parent
ffe2c56f42
commit
e6caf308b0
Loading…
Reference in new issue