Repository navigation
Commit fe54b6c
committed
fix(editor): fix annotation placeholder text and post-reload duration cap
Two bugs found during the 1.7.0 RC end-to-end pass:
1. New text annotations were created with the literal string
"Enter text..." baked into their actual content, instead of starting
empty with a real placeholder. The properties panel's textarea already
had a proper `placeholder` attribute wired up, but since the field's
*value* was never actually empty, the placeholder never showed and
clicking in to type appended after the baked-in text instead of
replacing it. Fixed by defaulting new text annotations' content to ""
(both on creation and when switching an existing annotation's type to
"text"), matching the pattern already used for "image"/"figure"/"blur"
types.
2. After Save Project -> Load Project, the editor's scrubber/seek range
was capped at the last timeline element's end time instead of the true
recording duration. Root cause: `applyLoadedProject` sets `duration`
to an inferred placeholder value (max of all region endMs) as a
provisional guess before the real video metadata loads, expecting
`VideoPlayback`'s `syncResolvedDuration` to correct it once the video
element reports its real duration. But `syncResolvedDuration` skips
calling `onDurationChange` whenever the resolved value matches
`lastResolvedDurationRef` -- a memoization guard against redundant
updates that has no way to know `applyLoadedProject` just set `duration`
to something else. If the real duration happened to match what the ref
already remembered from before the reload (the common case, since it's
the same video file), the correction never fired and the inferred
placeholder stuck. Fixed by exposing a `resetDurationResolution()`
method on `VideoPlaybackRef` that clears the memoization guard, called
from `applyLoadedProject` right when it sets the placeholder duration --
forcing the next metadata load to always re-sync regardless of what the
guard last saw.
Verified via computer-use against a real dev build:
- New annotation's text field now shows a genuine empty value (real
greyed placeholder, timeline label reads "Empty text"); typing replaces
cleanly with no leftover baked-in text.
- Loading a saved project with a trim region correctly shows the full
original duration (1:10) and scrubs all the way to the end, instead of
being capped at the last element's end time (previously 0:47).
Full suite: 53 files / 423 tests pass. tsc --noEmit and biome check clean.1 parent 44829d6 commit fe54b6c
2 files changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
407 | 412 | | |
408 | 413 | | |
409 | 414 | | |
| |||
1477 | 1482 | | |
1478 | 1483 | | |
1479 | 1484 | | |
1480 | | - | |
| 1485 | + | |
1481 | 1486 | | |
1482 | 1487 | | |
1483 | 1488 | | |
| |||
1616 | 1621 | | |
1617 | 1622 | | |
1618 | 1623 | | |
1619 | | - | |
| 1624 | + | |
1620 | 1625 | | |
1621 | 1626 | | |
1622 | 1627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
168 | 176 | | |
169 | 177 | | |
170 | 178 | | |
| |||
695 | 703 | | |
696 | 704 | | |
697 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
698 | 709 | | |
699 | 710 | | |
700 | 711 | | |
| |||
0 commit comments