Skip to content

NavIcon ships only ~10 hardcoded icons; common module icons render as empty squares #92

Description

@antosubash

Summary

@simple-module-py/ui/components/NavIcon.tsx ships a hardcoded Record<string, React.ReactNode> with about 10 SVG icons (home, package, users, user, settings, shield, activity, files, layers, shield-check, log-out). When a module's register_menu_items declares an icon outside this set, NavIcon falls through to <span className="w-5 h-5" /> and the sidebar shows an empty placeholder where the icon should be.

Repro

The framework's own modules already request icons that don't exist in the map:

  • feature_flags/constants.py:24MENU_ICON = "flag" → no glyph
  • bell (commonly used by notification modules) → no glyph
  • bar-chart-3 (commonly used by report modules) → no glyph

App-level modules can't add new icons without forking NavIcon.tsx.

Expected

Either:

  1. The map covers a broader set of common lucide-react icon names, or
  2. NavIcon defers to lucide-react when the name isn't in the local map (icons-by-name lookup), or
  3. There's a documented host-level extension point for registering additional icons.

Workaround

In a downstream app I added a Vite resolve plugin that intercepts both the bare specifier @simple-module-py/ui/components/NavIcon and the relative ../components/NavIcon (the form SidebarLayout.tsx uses internally) to redirect to a local NavIcon.tsx with extra icons. `resolve.alias` on the bare specifier alone wasn't enough because SidebarLayout reaches for the relative path.

Acceptance

  • Built-in modules render with visible icons in the sidebar without app-level patching.
  • App-level modules can declare arbitrary lucide names without falling through to the empty placeholder.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions