Skip to content

Commit 619057a

Browse files
committed
docs(captions): describe the position-preset derivation, fix a drifted anchor
settings.ts:217,262 was already stale before this change; the new preset helpers land right above getCaptionSettings/patchCaptionSettings and shift it further, to :279,324. Kept separate from the fix commit: docs-only changes aren't part of what the release branch's cherry-pick lane accepts.
1 parent ede0b2c commit 619057a

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

‎technical-documentation/architecture/transcription-and-captions.md‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ unit falls back to the original words (`untranslatedUnits`,
519519

520520
Caption appearance lives in `document.legacyEditor.captions`, accessed
521521
through `getCaptionSettings` / `patchCaptionSettings`
522-
([`src/lib/ai-edition/captions/settings.ts:217,262`](../../src/lib/ai-edition/captions/settings.ts:217)).
522+
([`src/lib/ai-edition/captions/settings.ts:279,324`](../../src/lib/ai-edition/captions/settings.ts:279)).
523523

524524
| Field | Default | Notes |
525525
|---|---|---|
@@ -579,6 +579,25 @@ ends were hardcoded to ±45 while the result was clamped separately, which left
579579
the bottom anchor honouring only −45…+3 — nearly half the slider moved the handle
580580
and nothing else.
581581

582+
#### Position presets
583+
584+
`verticalPosition` and `offsetX`/`offsetY` are independent fields — a preset is
585+
not a separate mode the offsets are locked out of, it's just a point on the same
586+
range the slider already covers. `activeVerticalPositionPreset` /
587+
`activeHorizontalPositionPreset` (`settings.ts`, right after `captionOffsetRange`)
588+
read "is a preset active" back out of that: a preset counts as active only while
589+
its axis' offset is (within a small epsilon) exactly the value that preset would
590+
set, so dragging a slider away from a preset silently un-highlights it with no
591+
separate "active preset" field to keep in sync. Clicking a preset writes that
592+
clean value back (`offsetY: 0` for a vertical preset; `captionHorizontalPositionOffset`
593+
for a horizontal one) rather than leaving whatever nudge was already there, which
594+
is what makes the click read as "go here" instead of "go here, plus whatever was
595+
left over." `CaptionHorizontalPosition` (left/center/right) is a new axis of
596+
meaning distinct from `CaptionTextAlign` (same three words, but for aligning the
597+
text *inside* the band) — there is no stored `horizontalPosition` field; it is
598+
derived from `offsetX` exactly the way the vertical preset is derived from
599+
`offsetY`.
600+
582601
The Captions pane itself
583602
([`src/components/ai-edition/CaptionsPane.tsx`](../../src/components/ai-edition/CaptionsPane.tsx))
584603
is the only place that runs `transcribe` from the editor shell, and

0 commit comments

Comments
 (0)