Skip to content

Conversation

TorstenDittmann
Copy link
Contributor

  • 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';
Copy link
Member

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}`}>
Copy link
Member

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}`}>
Copy link
Member

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`}>
Copy link
Member

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.
@TorstenDittmann TorstenDittmann merged commit faff800 into main May 28, 2025
2 checks passed
@TorstenDittmann TorstenDittmann deleted the fix-top-nav-projects-list branch May 28, 2025 14:26
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.

2 participants