Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

function isTabSelected(key: string) {
return page.url.pathname.endsWith(`/${key}`);
return page.url.pathname.split('/').includes(key);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot this is not the issue. The tab is incorrect even when I'm on /project-x-y/overview/api-keys

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - the actual issue was that page.url.pathname accessed inside a function closure isn't reactive in Svelte 5 legacy mode. The reactive dependency needs to be directly in the template expression, which is the pattern used in account/header.svelte and auth/header.svelte.

Fixed in commit 010f2f8: isTabSelected now accepts pathname as a parameter, and page.url.pathname is passed directly from the template — ensuring the template re-evaluates reactively on navigation.

}

$: $registerCommands([
Expand Down