Commit 5b4b267
feat(editor): smart unit suffix — dim on focus, yield to explicit units
While editing a numeric field, the unit suffix now visually responds to
the draft content:
- Plain number / empty: suffix dims to 40% opacity (signals "default unit
if you commit a bare number")
- Explicit unit typed (hint showing): suffix fades to opacity-0 over
150ms (the conversion hint provides unit feedback instead)
- Unparseable text: suffix stays dimmed (field will revert on commit)
- At rest: unchanged full-opacity suffix
Uses opacity-0 rather than unmounting so the flex layout doesn't jump.
The predicate is simply `hint !== null` — it aligns exactly with
measurementHint's internal PLAIN_NUMBER guard.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 58339c6 commit 5b4b267
2 files changed
Lines changed: 20 additions & 2 deletions
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
334 | 343 | | |
335 | 344 | | |
336 | 345 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
333 | 342 | | |
334 | 343 | | |
335 | 344 | | |
| |||
0 commit comments