fix(editor): Render fallback icon for projects without one in sidebar#30572
Open
RicardoE105 wants to merge 1 commit into
Open
fix(editor): Render fallback icon for projects without one in sidebar#30572RicardoE105 wants to merge 1 commit into
RicardoE105 wants to merge 1 commit into
Conversation
Projects with a null icon (typically created before the icon feature landed) would render without any glyph in the sidebar, making them look like section titles and breaking list alignment. The favorites list already had a 'layers' fallback; this extends the same default to the main project list and centralizes it in a shared constant. https://linear.app/n8n/issue/ADO-5214
Bundle ReportChanges will increase total bundle size by 170 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
Files in
Files in
Files in
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 6 files
Architecture diagram
sequenceDiagram
participant Sidebar as ProjectSidebar
participant ProjectNav as ProjectNavigation
participant FavoritesNav as useFavoriteNavItems
participant ProjectsStore as ProjectsStore
participant Constants as projects.constants
participant ProjectSettings as ProjectSettings
Note over Sidebar,ProjectSettings: Render-time fallback for null project icons
Sidebar->>ProjectNav: render sidebar items
ProjectNav->>ProjectsStore: getProjectList()
ProjectsStore-->>ProjectNav: project list (icon may be null)
alt project.icon is null
ProjectNav->>Constants: import DEFAULT_PROJECT_ICON (icon: 'layers')
ProjectNav->>ProjectNav: render fallback icon from constant
else project.icon exists
ProjectNav->>ProjectNav: render project.icon as-is
end
Sidebar->>FavoritesNav: getFavoriteProjectItems()
FavoritesNav->>ProjectsStore: get project by resourceId
alt project found AND project.icon is null
FavoritesNav->>Constants: import DEFAULT_PROJECT_ICON
FavoritesNav->>FavoritesNav: use fallback icon
else project found AND project.icon exists
FavoritesNav->>FavoritesNav: use project.icon
else project not found (favorited but data not loaded)
FavoritesNav->>Constants: import DEFAULT_PROJECT_ICON
FavoritesNav->>FavoritesNav: use fallback icon
end
FavoritesNav-->>Sidebar: menu items with resolved icon
Note over ProjectSettings: Project settings page initializes icon state
ProjectSettings->>Constants: import DEFAULT_PROJECT_ICON
ProjectSettings->>ProjectSettings: initialize projectIcon ref from constant copy
Note over Constants: Shared constant used by all consumers
Constants->>Constants: defines DEFAULT_PROJECT_ICON = {type:'icon', value:'layers'}
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Idle baseline with Instance AI module loaded
Memory consumption baseline with starter plan resources
docker-stats
How to read this table
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Projects whose
iconisnull(typically created before the project icon feature shipped) were rendering without any glyph in the sidebar — making them look like section titles and breaking list alignment.This adds a render-time fallback: when a project has no icon, the sidebar shows the same
layersicon that's already used as the default for new projects and for favorited projects whose data isn't loaded yet. The literal is moved to a sharedDEFAULT_PROJECT_ICONconstant and reused fromProjectNavigation.vue,ProjectSettings.vue, anduseFavoriteNavItems.ts.No DB backfill — new projects already pick up
layerson first edit, and the render-time fallback covers legacy rows plus any future state whereiconis null.How to test
icontonullin the DB (UPDATE project SET icon = NULL WHERE id = '<id>').layersicon and proper alignment instead of looking like a section header.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-5214
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI