-
Notifications
You must be signed in to change notification settings - Fork 191
Refactor breadcrumbs to use page store for selected project #1928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
TorstenDittmann
commented
May 28, 2025
- Replace project selection logic with page.data.project
- Add type annotations for better type safety
- Clean up component formatting and remove unused isSelected property
- Replace project selection logic with page.data.project - Add type annotations for better type safety - Clean up component formatting and remove unused isSelected property
import { base } from '$app/paths'; | ||
import { newOrgModal } from '$lib/stores/organization'; | ||
import { Click, trackEvent } from '$lib/actions/analytics'; | ||
import { page } from '$app/stores'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not page
from $app/state
?
href={`/console/project-${project.region}-${project.$id}`} | ||
>{project.name}</ActionMenu.Item.Anchor | ||
></ActionMenu.Root> | ||
href={`/console/project-${project.region}-${project.$id}`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not base
?
href={`/console/organization-${selectedOrg.$id}`} | ||
>All projects</ActionMenu.Item.Anchor | ||
></ActionMenu.Root> | ||
href={`/console/organization-${selectedOrg.$id}`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for base
href={`/console/organization-${selectedOrg?.$id}?create-project`} | ||
>Create project</ActionMenu.Item.Anchor | ||
></ActionMenu.Root> | ||
href={`/console/organization-${selectedOrg?.$id}?create-project`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Replace hardcoded `/console` paths with `${base}` prefix and migrate from `$app/stores` to `$app/state` for page access.
Change import from `$app/state` to `$app/stores` and update usage from `page.data.project` to `$page.data.project` to properly access the reactive store value.
Adds isSelected boolean to project objects based on current page params and applies NavbarProject type constraint with satisfies operator.