Fix : scope picker followups#3020
Conversation
Greptile SummaryThis PR fixes several follow-up issues in the scope picker: the Confidence Score: 5/5This PR is safe to merge — no P0 or P1 issues found. All changes are correctness improvements: deduplication logic works as intended, the onMount priority flip is the right fix (API over local), and the UI label restructure properly addresses the previous accessibility concern. No regressions or logic errors identified. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Make scope descriptions toggle checkboxe..." | Re-trigger Greptile |
| const categories = $derived.by(() => { | ||
| const availableCategories = new Set( | ||
| filteredScopes.map((scope) => normalizeCategory(scope.category)) | ||
| return Array.from( | ||
| new Set(filteredScopes.map((scope) => normalizeCategory(scope.category))) | ||
| ); | ||
|
|
||
| return [ | ||
| ...categoryOrder.filter((category) => availableCategories.has(category)), | ||
| ...Array.from(availableCategories).filter( | ||
| (category) => !categoryOrder.includes(category as Category) | ||
| ) | ||
| ]; | ||
| }); |
There was a problem hiding this comment.
Category ordering lost after removing
categoryOrder
The removed Category enum and categoryOrder array enforced a deterministic display order (Project → Auth → Databases → Functions → Storage → Messaging → Sites → Domains → Other). The new $derived.by simply emits categories in whatever insertion order the filteredScopes Map iteration produces, which depends entirely on API response order. If the server returns scopes in a different sequence, categories will shuffle — producing an inconsistent UI across environments or API versions.
There was a problem hiding this comment.
@greptile its fine if coming from be
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)