Skip to content

Commit 958892f

Browse files
committed
Address freebuff picker review comments
1 parent 7c283c7 commit 958892f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

cli/src/utils/freebuff-model-navigation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export function nextSelectableFreebuffModelId(params: {
1111
if (currentIdx === -1) return null
1212

1313
const step = direction === 'forward' ? 1 : -1
14+
// Include a full wrap back to the current item so arrows stay on the same
15+
// selectable model when every peer is unavailable.
1416
for (let offset = 1; offset <= modelIds.length; offset++) {
1517
const idx =
1618
(currentIdx + step * offset + modelIds.length) % modelIds.length
@@ -30,7 +32,6 @@ export function resolveFreebuffModelCommitTarget(params: {
3032
const { focusedId, selectedId, committedId, isSelectable } = params
3133
const targetId = isSelectable(focusedId) ? focusedId : selectedId
3234

33-
if (targetId === committedId) return null
34-
if (!isSelectable(targetId)) return null
35+
if (!isSelectable(targetId) || targetId === committedId) return null
3536
return targetId
3637
}

0 commit comments

Comments
 (0)