mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-08-15 21:27:14 +00:00
Address review: force target to All when the pane picker is hidden
When only one pane is live the Target row is hidden, but _aspectEditTarget could remain a specific pane key — silently routing edits into a hidden (and persistent arr:*) override in single-player. Reset the edit target to "" in _aspectBuildTargets whenever the row is hidden (or the selected pane is gone), so single-pane edits always go to the shared base. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: topkoa <topkoa@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
817db6382b
commit
58047e6ad6
@@ -1837,7 +1837,13 @@
|
|||||||
o.value = pk; o.textContent = reg[pk].label;
|
o.value = pk; o.textContent = reg[pk].label;
|
||||||
_aspectTargetSel.appendChild(o);
|
_aspectTargetSel.appendChild(o);
|
||||||
});
|
});
|
||||||
if (_aspectEditTarget && !reg[_aspectEditTarget]) _aspectEditTarget = '';
|
// Force the edit target back to "All" when the Target row is hidden
|
||||||
|
// (single pane) or the selected pane is gone — otherwise a stale pane
|
||||||
|
// target would silently route edits into a hidden (and persistent
|
||||||
|
// arr:*) override in single-player.
|
||||||
|
if (keys.length <= 1 || (_aspectEditTarget && !reg[_aspectEditTarget])) {
|
||||||
|
_aspectEditTarget = '';
|
||||||
|
}
|
||||||
_aspectTargetSel.value = _aspectEditTarget;
|
_aspectTargetSel.value = _aspectEditTarget;
|
||||||
// The Target row only matters with more than one pane (a split). With a
|
// The Target row only matters with more than one pane (a split). With a
|
||||||
// single pane there's nothing to disambiguate, so hide it.
|
// single pane there's nothing to disambiguate, so hide it.
|
||||||
|
|||||||
@@ -235,6 +235,14 @@ test('pruning drops the matching readout slot and a dangling __last', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('single-pane forces the edit target back to All (no hidden pane edits)', () => {
|
||||||
|
assert.match(
|
||||||
|
src,
|
||||||
|
/if\s*\(\s*keys\.length\s*<=\s*1\s*\|\|\s*\(\s*_aspectEditTarget\s*&&\s*!reg\[_aspectEditTarget\]\s*\)\s*\)\s*\{\s*_aspectEditTarget\s*=\s*''/,
|
||||||
|
'_aspectBuildTargets must reset the edit target to "" when the Target row is hidden',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test('the panel has a dismiss (close) control', () => {
|
test('the panel has a dismiss (close) control', () => {
|
||||||
assert.match(
|
assert.match(
|
||||||
src,
|
src,
|
||||||
|
|||||||
Reference in New Issue
Block a user