fix(coding-agent): keep scoped-model reorder inert in implicit all-enabled state closes #3331
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed `/scoped-models` Alt+Up/Down to stay a no-op in the implicit `all enabled` state instead of materializing a full explicit enabled-model list and marking the selector dirty ([#3331](https://github.com/badlogic/pi-mono/issues/3331))
|
||||||
- Fixed flaky git package update notifications by waiting for captured git command stdio to fully drain before comparing local and remote commit SHAs ([#3027](https://github.com/badlogic/pi-mono/issues/3027))
|
- Fixed flaky git package update notifications by waiting for captured git command stdio to fully drain before comparing local and remote commit SHAs ([#3027](https://github.com/badlogic/pi-mono/issues/3027))
|
||||||
- Fixed auto-retry transient error detection to treat `Network connection lost.` as retryable, so dropped provider connections retry instead of terminating the agent ([#3317](https://github.com/badlogic/pi-mono/issues/3317))
|
- Fixed auto-retry transient error detection to treat `Network connection lost.` as retryable, so dropped provider connections retry instead of terminating the agent ([#3317](https://github.com/badlogic/pi-mono/issues/3317))
|
||||||
- Fixed compact interactive extension startup summaries to disambiguate package extensions and repeated local `index.ts` entries by using package-aware labels and the minimal parent path needed to make local entries unique ([#3308](https://github.com/badlogic/pi-mono/issues/3308))
|
- Fixed compact interactive extension startup summaries to disambiguate package extensions and repeated local `index.ts` entries by using package-aware labels and the minimal parent path needed to make local entries unique ([#3308](https://github.com/badlogic/pi-mono/issues/3308))
|
||||||
|
|||||||
@@ -45,8 +45,9 @@ function clearAll(enabledIds: EnabledIds, allIds: string[], targetIds?: string[]
|
|||||||
return enabledIds.filter((id) => !targets.has(id));
|
return enabledIds.filter((id) => !targets.has(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
function move(enabledIds: EnabledIds, allIds: string[], id: string, delta: number): EnabledIds {
|
function move(enabledIds: EnabledIds, id: string, delta: number): EnabledIds {
|
||||||
const list = enabledIds ?? [...allIds];
|
if (enabledIds === null) return null;
|
||||||
|
const list = [...enabledIds];
|
||||||
const index = list.indexOf(id);
|
const index = list.indexOf(id);
|
||||||
if (index < 0) return list;
|
if (index < 0) return list;
|
||||||
const newIndex = index + delta;
|
const newIndex = index + delta;
|
||||||
@@ -238,15 +239,15 @@ export class ScopedModelsSelectorComponent extends Container implements Focusabl
|
|||||||
|
|
||||||
// Alt+Up/Down - Reorder enabled models
|
// Alt+Up/Down - Reorder enabled models
|
||||||
if (matchesKey(data, Key.alt("up")) || matchesKey(data, Key.alt("down"))) {
|
if (matchesKey(data, Key.alt("up")) || matchesKey(data, Key.alt("down"))) {
|
||||||
|
if (this.enabledIds === null) return;
|
||||||
const item = this.filteredItems[this.selectedIndex];
|
const item = this.filteredItems[this.selectedIndex];
|
||||||
if (item && isEnabled(this.enabledIds, item.fullId)) {
|
if (item && isEnabled(this.enabledIds, item.fullId)) {
|
||||||
const delta = matchesKey(data, Key.alt("up")) ? -1 : 1;
|
const delta = matchesKey(data, Key.alt("up")) ? -1 : 1;
|
||||||
const enabledList = this.enabledIds ?? this.allIds;
|
const currentIndex = this.enabledIds.indexOf(item.fullId);
|
||||||
const currentIndex = enabledList.indexOf(item.fullId);
|
|
||||||
const newIndex = currentIndex + delta;
|
const newIndex = currentIndex + delta;
|
||||||
// Only move if within bounds
|
// Only move if within bounds
|
||||||
if (newIndex >= 0 && newIndex < enabledList.length) {
|
if (newIndex >= 0 && newIndex < this.enabledIds.length) {
|
||||||
this.enabledIds = move(this.enabledIds, this.allIds, item.fullId, delta);
|
this.enabledIds = move(this.enabledIds, item.fullId, delta);
|
||||||
this.isDirty = true;
|
this.isDirty = true;
|
||||||
this.selectedIndex += delta;
|
this.selectedIndex += delta;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|||||||
Reference in New Issue
Block a user