Skip to content

fix(editor): Render fallback icon for projects without one in sidebar#30572

Open
RicardoE105 wants to merge 1 commit into
masterfrom
worktree-ado-5214-project-icon-fallback
Open

fix(editor): Render fallback icon for projects without one in sidebar#30572
RicardoE105 wants to merge 1 commit into
masterfrom
worktree-ado-5214-project-icon-fallback

Conversation

@RicardoE105
Copy link
Copy Markdown
Contributor

@RicardoE105 RicardoE105 commented May 16, 2026

Summary

Projects whose icon is null (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 layers icon 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 shared DEFAULT_PROJECT_ICON constant and reused from ProjectNavigation.vue, ProjectSettings.vue, and useFavoriteNavItems.ts.

No DB backfill — new projects already pick up layers on first edit, and the render-time fallback covers legacy rows plus any future state where icon is null.

How to test

  1. Set a team project's icon to null in the DB (UPDATE project SET icon = NULL WHERE id = '<id>').
  2. Reload the sidebar — the project should render with the layers icon 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

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive.
  • Tests included.
  • Docs updated or follow-up ticket created.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

🤖 PR Summary generated by AI

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
@RicardoE105 RicardoE105 marked this pull request as ready for review May 16, 2026 17:37
@RicardoE105 RicardoE105 requested a review from nikhilkuria May 16, 2026 17:37
@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Bundle Report

Changes will increase total bundle size by 170 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
editor-ui-esm 46.74MB 170 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/users.store-*.js 92 bytes 889.61kB 0.01%
assets/ProjectSettings-*.js 14 bytes 74.5kB 0.02%
assets/AppSidebar-*.js 64 bytes 35.39kB 0.18%

Files in assets/users.store-*.js:

  • ./src/features/collaboration/projects/projects.constants.ts → Total Size: 207 bytes

Files in assets/ProjectSettings-*.js:

  • ./src/features/collaboration/projects/views/ProjectSettings.vue → Total Size: 354 bytes

Files in assets/AppSidebar-*.js:

  • ./src/features/collaboration/projects/components/ProjectNavigation.vue → Total Size: 371 bytes

  • ./src/features/collaboration/projects/composables/useFavoriteNavItems.ts → Total Size: 3.36kB

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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'}
Loading

Re-trigger cubic

@github-actions
Copy link
Copy Markdown
Contributor

Performance Comparison

Comparing currentlatest master14-day baseline

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-rss-baseline 368.49 MB 368.49 MB 383.86 MB (σ 18.97) +0.0% -4.0%
instance-ai-heap-used-baseline 197.32 MB 197.32 MB 196.10 MB (σ 2.07) +0.0% +0.6%

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-rss-baseline 306.13 MB 306.13 MB 293.88 MB (σ 24.78) +0.0% +4.2%
memory-heap-used-baseline 122.21 MB 122.21 MB 122.33 MB (σ 1.72) +0.0% -0.1%

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-runners 389.00 MB 389.00 MB 398.00 MB (σ 12.41) +0.0% -2.3%
docker-image-size-n8n 1372.16 MB 1372.16 MB 1334.40 MB (σ 59.21) +0.0% +2.8%
How to read this table
  • Current: This PR's value (or latest master if PR perf tests haven't run)
  • Latest Master: Most recent nightly master measurement
  • Baseline: Rolling 14-day average from master
  • vs Master: PR impact (current vs latest master)
  • vs Baseline: Drift from baseline (current vs rolling avg)
  • Status: ✅ within 1σ | ⚠️ 1-2σ | 🔴 >2σ regression

@n8n-assistant n8n-assistant Bot added the n8n team Authored by the n8n team label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant