Skip to content

Commit 1d6c084

Browse files
committed
fix(studio): the save bar's registry adds a buffer with enlist, not register
Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb Co-authored-by: Claude <noreply@anthropic.com>
1 parent 38d5312 commit 1d6c084

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/studioSaveBar.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export interface StudioSaveEntry {
6767
}
6868

6969
interface StudioSaveRegistry {
70-
register: (id: number, entry: React.MutableRefObject<StudioSaveEntry | null>) => () => void;
70+
/** Add a buffer; the answer removes it. (Not `register`: that name is the component registry's.) */
71+
enlist: (id: number, entry: React.MutableRefObject<StudioSaveEntry | null>) => () => void;
7172
/** An entry's `dirty` or `held` changed: the top bar re-reads them. */
7273
changed: () => void;
7374
}
@@ -94,7 +95,7 @@ export function useStudioSaveEntry(entry: StudioSaveEntry | null): void {
9495
const [id] = React.useState(() => ++nextEntryId);
9596
React.useEffect(() => {
9697
if (!registry) return;
97-
return registry.register(id, ref);
98+
return registry.enlist(id, ref);
9899
}, [registry, id]);
99100
const dirty = entry?.dirty ?? false;
100101
const held = entry?.held ?? null;
@@ -127,7 +128,7 @@ export function useStudioSaveCoordinator(locale: string): StudioSaveCoordinator
127128
}, []);
128129
// A state initializer, so its identity is the surface's for life (AGENTS.md #10).
129130
const [registry] = React.useState<StudioSaveRegistry>(() => ({
130-
register: (id, ref) => {
131+
enlist: (id, ref) => {
131132
entriesRef.current.set(id, ref);
132133
setDirty(readDirty());
133134
return () => {

0 commit comments

Comments
 (0)