commit e5dbbbd79e5a443c29585fe8a4c0823583648a58
parent 75be66757d809479ea1da3ffd65a16272057f59c
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 17 Nov 2026 13:39:19 -0500
ReadAgain: no press before the baseline is known
A press made before the item's pieces were read started from the last read's
numbers and asked them as the line's own (the must's e2e caught it after a reload).
Read again, Read edited text and Read with these wait for it.
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat:
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/umtool/components/projects/read/ReadAgain.tsx b/umtool/components/projects/read/ReadAgain.tsx
@@ -94,7 +94,7 @@ export function madeWithText(t: { reading?: number | null; tuning?: Tuning | nul
}
export default function ReadAgain({
- what = "", busy = false, waiting = null, canReadAgain = true, edited = false, onReadAgain, onReadEdited, madeWith = null, baseline = null, character = null, keepForCharacter, error = null, note = null, autoplay, onAutoplay,
+ what = "", busy = false, waiting = null, canReadAgain = true, edited = false, onReadAgain, onReadEdited, madeWith = null, baseline = undefined, character = null, keepForCharacter, error = null, note = null, autoplay, onAutoplay,
}: {
/** What is read, in the controls' names: "" (the post), "line 2", "the thread", "the card". */
what?: string;
@@ -109,7 +109,11 @@ export default function ReadAgain({
onReadEdited?: (tuning: Tuning | null) => void;
/** How the line was last made: the Tune numbers start from it (with no `baseline`, S3's rule). */
madeWith?: Tuning | null;
- /** What a plain press reads it with now (lane character-tuning): the Tune starts there, and a press sends only what differs. */
+ /**
+ * What a plain press reads it with now (lane character-tuning): the Tune starts there, and a press sends only what
+ * differs. null: not known yet -- the presses wait for it (a press before would ask the last read's numbers as the
+ * line's own); absent: S3's rule (the last read's numbers).
+ */
baseline?: TuneBaseline | null;
/** The character this line is read by, when known: S2 keeps a tuning for it. */
character?: { id: string; name: string; layer?: string } | null;
@@ -141,6 +145,8 @@ export default function ReadAgain({
* takes when given (S3's rule).
*/
const ask = (): Tuning | null => (baseline?.character ? (tuneAskOf(draft, baseline) as Tuning | null) : tuningAsked(draft));
+ // The baseline is being read: no press yet (it would start from the last read's numbers).
+ const loading = baseline === null;
/** What a Keep keeps: the sampler as it stands, top k and min p when not their defaults, the takes only when typed. */
const keepAsk = (): Tuning => keepAskOf(draft, { takesTyped }) as Tuning;
const baseWords = !baseline ? null : baseline.madeOwn ? "this line's own" : baseline.character ? `${baseline.character.name}: ${NAMED[ttsTuningNameOf(baseline.character.tuning ?? {})] ?? "custom"}` : "defaults";
@@ -154,11 +160,11 @@ export default function ReadAgain({
});
return (
<div className="flex flex-wrap items-center gap-1.5" data-read-again={what || "post"}>
- <button type="button" className={btn} disabled={busy || bad || !canReadAgain} onClick={() => onReadAgain(ask())} aria-label={what ? `Read ${what} again` : "Read again"} data-read-again-button="">
+ <button type="button" className={btn} disabled={busy || bad || loading || !canReadAgain} onClick={() => onReadAgain(ask())} aria-label={what ? `Read ${what} again` : "Read again"} data-read-again-button="">
Read again
</button>
{onReadEdited && (
- <button type="button" className={btn} disabled={busy || bad || !edited} onClick={() => onReadEdited(ask())} aria-label={what ? `Read ${what} as edited` : "Read the edited text"} data-read-edited-button="">
+ <button type="button" className={btn} disabled={busy || bad || loading || !edited} onClick={() => onReadEdited(ask())} aria-label={what ? `Read ${what} as edited` : "Read the edited text"} data-read-edited-button="">
Read edited text
</button>
)}
@@ -186,7 +192,7 @@ export default function ReadAgain({
);
})}
<div className="flex flex-wrap gap-1.5 pt-1">
- <button type="button" className={btn} disabled={busy || bad || !canReadAgain} onClick={() => onReadAgain(ask())} aria-label={what ? `Read ${what} again with this tuning` : "Read again with this tuning"} data-read-tune-read="">
+ <button type="button" className={btn} disabled={busy || bad || loading || !canReadAgain} onClick={() => onReadAgain(ask())} aria-label={what ? `Read ${what} again with this tuning` : "Read again with this tuning"} data-read-tune-read="">
Read with these
</button>
<button type="button" className={btn} onClick={() => setDraft(Object.fromEntries(TTS_TUNING_FIELDS.map((k: string) => [k, k in DEFAULTS ? String(DEFAULTS[k]) : ""])))} aria-label="Tuning back to the defaults" data-read-tune-defaults="">