Repository navigation
feat(visual-builder): show fields disabled while the entry is locked by another session (DRFT-925) #664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(visual-builder): show fields disabled while the entry is locked by another session (DRFT-925) #664
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ export type EntryFieldLockInfo = Record<string, EntryFieldLock>; | |
| /** Why the parent has turned editing off for a whole entry scope. */ | ||
| export type EntryEditRestriction = | ||
| | "olderVersion" | ||
| | "entryLocked" | ||
| | "unlocalized" | ||
| | "unsavedVariant"; | ||
|
|
||
|
|
@@ -122,6 +123,7 @@ export function getEntryEditRestrictionWriteSeq(): number { | |
|
|
||
| const RESTRICTIONS: ReadonlySet<string> = new Set([ | ||
| "olderVersion", | ||
| "entryLocked", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit — This set repeats the
Keying it by the union turns that into a compile error: const RESTRICTIONS: Record<EntryEditRestriction, true> = {
olderVersion: true,
entryLocked: true,
unlocalized: true,
unsavedVariant: true,
};
Generated by Claude Code |
||
| "unlocalized", | ||
| "unsavedVariant", | ||
| ]); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should fix — This exercises the union member and the message, but not the line that makes the feature work across the parent boundary.
setEntryEditRestrictiontakes an already-typedEntryEditRestrictionand writes it straight to the store, so nothing here passes throughtoEntryEditRestriction. The"entryLocked"entry you added toRESTRICTIONSinfieldLockStore.tsis the only thing that lets the parent's string survive, and it has no coverage: delete that one line and this suite still passes while a locked entry stays fully editable on a real canvas.Worth a case on the parent path, alongside the existing
ENTRY_EDIT_RESTRICTION_UPDATEtest in therestriction updatesblock:Generated by Claude Code