-
Notifications
You must be signed in to change notification settings - Fork 198
Fix project dropdown not refreshing after project creation or deletion #2547
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
base: main
Are you sure you want to change the base?
Conversation
Console (appwrite/console)Project ID: Tip Schedule functions to run as often as every minute with cron expressions |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Comment |
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
stnguyen90
left a comment
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.
@copilot make sure the dropdown refreshes after deleting a project too
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Fixed in ba2dc94. The dropdown now refreshes after project deletion by tracking navigation state. When a user navigates away from a project page (e.g., to the org page after deletion) and then back to another project, the cache is invalidated to force a reload. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| // Invalidate cache when navigating from non-project page back to project page | ||
| // This handles cases like project deletion where user is redirected to org page | ||
| $: { | ||
| const isOnProjectPage = !!currentProject; | ||
| const hasNavigatedBackToProjects = | ||
| isOnProjectPage && !wasOnProjectPage && loadedProjects.projects.length > 0; | ||
| if (hasNavigatedBackToProjects) { | ||
| // Clear cache to force reload after being away from project pages | ||
| loadedProjects = { total: 0, projects: [] }; | ||
| } | ||
| wasOnProjectPage = isOnProjectPage; | ||
| } | ||
| $: shouldReloadProjects = isLoadingProjects | ||
| ? false | ||
| : currentProject && loadedProjects.projects.length | ||
| ? loadedProjects.projects[0].teamId != currentProject.teamId | ||
| ? // All projects in cache belong to same org, so check first project's teamId | ||
| loadedProjects.projects[0].teamId != currentProject.teamId || | ||
| !loadedProjects.projects.some((p) => p.$id === currentProject.$id) | ||
| : !loadedProjects.projects.length; |
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.
@copilot this seems quite complicated. to detect if a project was deleted or created, can we just use the allProjectsCount?
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.
Simplified in 2c721bf. Now using page.data.allProjectsCount to detect project creation/deletion by comparing it with the cached total. Removed the complex navigation tracking logic entirely.
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Ensure the project dropdown reloads correctly when creating/deleting projects.

Project dropdown shows stale cached list after creating a new project or deleting a project within the same organization.
Changes
Modified
src/lib/components/breadcrumbs.svelteshouldReloadProjectsreactive statementallProjectsCountfrom page data to detect project creation/deletionPreviously only reloaded on team ID change or empty cache. Now also:
allProjectsCount(handles both creation and deletion)This approach uses the existing
allProjectsCountfrom the layout data instead of complex navigation tracking, making the solution simpler and more maintainable.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.