Skip to content

fix: auto-select remaining request after deleting second of two#1657

Open
Fikri-20 wants to merge 1 commit intofoss42:mainfrom
Fikri-20:fix/request-selection-after-delete
Open

fix: auto-select remaining request after deleting second of two#1657
Fikri-20 wants to merge 1 commit intofoss42:mainfrom
Fikri-20:fix/request-selection-after-delete

Conversation

@Fikri-20
Copy link
Copy Markdown
Contributor

@Fikri-20 Fikri-20 commented Apr 13, 2026

Fixes a bug where deleting the second request when only two exist leaves the UI with no request selected, even though one remains in the sidebar.

Video before resolving the bug

prob.mp4

Video after resolving the bug

sol.mp4

Root cause: lib/providers/collection_providers.dart line 131

// Before
} else if (itemIds.length > 1) {

// After
} else if (idx > 0) {

After removing the item, itemIds.length is 1 — so 1 > 1 is false and nothing gets selected. Using idx > 0 correctly selects the previous item regardless of list length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant