mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 02:29:33 +01:00
fix(tabs): Follow parent again keeps a Focus pin (#528/#582 integration)
#528's browser followParent operation rebuilt the target ref as { kind, id } to drop its manual placement, which also dropped #582's `focus` flag. The browser PUTs whole layouts, so the pin was erased on the next save. The operation now copies the ref and removes only `placement`. #528's row-menu test also expects #582's 'Add to Focus' entry now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a6ce52d3e7
commit
5d31e42db0
2 files changed
+20
-2
No files matched your search
@@ -699,7 +699,14 @@
|
||||
if (!state || state.state === 'dangling' || state.state === 'cycle') editError('no parent to follow');
|
||||
if (state.state !== 'manual') return layout;
|
||||
const targetKey = refKey(op.ref);
|
||||
const clear = (ref) => (refKey(ref) === targetKey ? { kind: ref.kind, id: ref.id } : ref);
|
||||
// Drop the placement only: a Focus pin stays (the whole layout is PUT,
|
||||
// so a field left off here would be erased on save).
|
||||
const clear = (ref) => {
|
||||
if (refKey(ref) !== targetKey) return ref;
|
||||
const copy = copyRef(ref);
|
||||
delete copy.placement;
|
||||
return copy;
|
||||
};
|
||||
for (const group of layout.groups) group.refs = group.refs.map(clear);
|
||||
layout.ungrouped = layout.ungrouped.map(clear);
|
||||
const childKeys = new Set();
|
||||
|
||||
Reference in new issue
Block a user