Skip to content

Onboarding topic icons: replace hardcoded code allowlist with data-driven mapping + fallback #600

Description

@nicholasjjlim

Background

Follow-up from the code review on #599 (which fixed #598).

To restore the topic icons in the onboarding picker, #599 keys each icon off the collection's tag code via a hardcoded allowlist in the frontend (TOPIC_ICON_CODES in src/lib/components/OnboardingView/OnboardingView.svelte). Topic collections whose tag code is not in that set — or whose tag is null — are silently filtered out of the picker.

This is a smaller, relocated form of the exact UI/DB drift class that #598 set out to eliminate: the frontend once again hardcodes a set of strings that must stay in sync with the database. A topic added in the DB with a new/unmapped tag code will silently not appear, with no error and no log.

It also underlies the High-severity edge from the same review (#599 review thread): because the filtered list is the only thing rendered and onboarding requires selecting ≥3 topics, if fewer than 3 collections have an icon-mapped code the flow becomes an unrecoverable dead-end.

Acceptance criteria

  • Every isTopic = true collection is selectable in onboarding regardless of whether it has a recognized icon (no silent drop).
  • A topic without a specific icon renders with a sensible default/placeholder icon rather than being hidden.
  • The icon mapping is not a hardcoded frontend allowlist that must be manually kept in sync with the database (e.g. derive it from data, or drive it from a single shared source with a documented default path).
  • If a topic can't be mapped to an icon, that is observable (e.g. logged) rather than silent.

Out of scope

Notes

Raised from review comments on #599


🌊 Managed by Currents · Task 2fc6a0db-c70e-48e5-b601-34661dd9135d

{"metadata":{"sourceType":"github"},"rank":"a0","taskId":"2fc6a0db-c70e-48e5-b601-34661dd9135d","version":1}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions