fix: ensure the selected tab updates when switching tabs#2902
fix: ensure the selected tab updates when switching tabs#2902stnguyen90 wants to merge 1 commit intomainfrom
Conversation
`page.url.pathname`` was accessed inside the `isTabSelected()`` function closure. In Svelte 5 legacy mode components, reactive state accessed inside a function closure does not create a reactive dependency in the template - so the tab selection was computed once at layout mount (always on `/platforms` due to the redirect) and never updated on navigation.
Console (appwrite/console)Project ID: Tip JWT tokens let functions act on behalf of users while preserving their permissions |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis pull request refactors the tab selection mechanism in a project overview layout component. The old Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes a Svelte 5 legacy mode reactivity issue where the active tab in the Integrations section of the project overview was not updating when navigating between tabs. It also corrects a broken command palette shortcut for creating dev keys.
Confidence Score: 5/5
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User navigates to /overview tab] --> B{page.url.pathname}
B --> C["pathParts = pathname.split('/')"]
C --> D{Check each Tab}
D --> E["pathParts.includes('platforms')"]
D --> F["pathParts.includes('api-keys')"]
D --> G["pathParts.includes('dev-keys')"]
E -->|true| H[Platforms tab selected]
F -->|true| I[API Keys tab selected]
G -->|true| J[Dev Keys tab selected]
H --> K[Tab UI updates reactively]
I --> K
J --> K
K --> L{Command palette 'Create Dev Key'}
L --> M["goto(path + '/dev-keys')"]
M --> N[Navigate to /dev-keys list page]
Last reviewed commit: 751a45d |

What does this PR do?
page.url.pathnamewas accessed inside theisTabSelected()function closure. In Svelte 5 legacy mode components, reactive state accessed inside a function closure does not create a reactive dependency in the template - so the tab selection was computed once at layout mount (always on/platformsdue to the redirect) and never updated on navigation.Test Plan
Manually tested:
Screen.Recording.2026-03-05.at.08.59.45.mov
Related PRs and Issues
None
Have you read the Contributing Guidelines on issues?
Yes
Summary by CodeRabbit