Skip to content

feat(frontend): add provider icons#5034

Merged
jog1t merged 1 commit into
mainfrom
05-11-feat_frontend_add_provider_icons
May 15, 2026
Merged

feat(frontend): add provider icons#5034
jog1t merged 1 commit into
mainfrom
05-11-feat_frontend_add_provider_icons

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented May 11, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 11, 2026

PR Review: feat(frontend): add provider icons

Overview

Adds custom branding (icon + display name) for custom runner providers. Users connecting with custom or custom-platform providers can now pick a FontAwesome icon and label that appears in the provider list. The core of this is a new IconPicker component that lazily loads icons and virtualizes the grid for performance.


Issues

icon-picker.tsx"use client" directive is unnecessary
This is a Next.js-specific directive. The project uses TanStack Router. Remove it to avoid confusion.

icon-picker.tsxloadAllIcons imports the entire icon library eagerly
import("@rivet-gg/icons") pulls the full icon library into a single chunk the moment the picker opens. The lazy per-file loading via import.meta.glob used for IconRenderer is the right pattern for display; consider using the same approach for the picker grid to avoid a large upfront fetch (or at minimum document the tradeoff).

data.ts — redundant .partial()
All fields in providerMetadataSchema are already marked .optional(), making the chained .partial() a no-op. Remove it.

const providerMetadataSchema = z
  .object({
    provider: z.string().optional(),
    customName: z.string().optional(),
    customIcon: z.string().optional(),
  })
  // .partial() is redundant — all fields above are already optional
  .optional();

isCustomProvider is duplicated across files
The helper isCustomProvider(provider) is defined inline in runner-config-table.tsx but the same logic (provider === "custom" || provider === "custom-platform") is also repeated in the two dialog frame files and the form. Move it to lib/data.ts alongside the other deriveX helpers.

data.ts — each deriveX call re-parses the same metadata object
When all three helpers are called together (as in runner-config-table.tsx), the Zod schema is applied three times to the same value. Parse once and return a structured object, or combine into a single deriveProviderBrandingFromMetadata helper.

CustomBranding component — preview not shown in the default state
The preview block is only rendered when name || icon is truthy. A user who fills neither field won't see the "Custom" default label rendered, which is the exact case worth previewing. Consider showing the preview unconditionally.


Minor / Nits

  • icon-picker.tsx — keyboard navigation: The virtualized grid has no arrow-key navigation. Tabbing through hundreds of icon buttons is painful. Consider roving tabindex or at minimum grouping focus so Tab advances row-by-row.
  • icon-picker.tsxgetLazyIcon keyed on exportName, not iconName: The cache map key is exportName (e.g. faRocket), which is consistent, but the function parameter is the raw icon name (e.g. rocket). The asymmetry between the parameter and the cache key is a readability concern — add a comment or rename one.
  • connect-manual-serverfull-frame.tsx — trimming already handled in Zod schema: values.customName?.trim() || undefined duplicates the .trim() already present in the Zod schema. Rely on the schema output instead.
  • icon-picker.stories.tsx — raw <input> instead of project Input: InsideProviderRow uses a plain <input>. Use the project's Input component for consistency with the real form.

What's working well

  • Virtualizing the icon grid with @tanstack/react-virtual is the right call for a large icon set.
  • The lazy-load cache (lazyIconCache) prevents redundant module fetches.
  • groupKey in ProviderSummary correctly groups custom providers by both name and icon, avoiding misleading de-duplication.
  • Using safeParse instead of parse in data.ts (changed from the original) is more resilient to unexpected metadata shapes.
  • Storybook stories cover the empty, preselected, and unknown-icon-name cases — good defensive coverage.

@jog1t jog1t force-pushed the 05-11-feat_frontend_add_provider_icons branch from 97c2f75 to 577a189 Compare May 11, 2026 18:49
@jog1t jog1t force-pushed the 05-11-refactor_forntend_improve_providers_table branch from 223bdc0 to 2b7c11e Compare May 11, 2026 18:49
@jog1t jog1t force-pushed the 05-11-feat_frontend_add_provider_icons branch from 577a189 to a23259e Compare May 15, 2026 19:30
@jog1t jog1t mentioned this pull request May 15, 2026
11 tasks
Copy link
Copy Markdown
Contributor Author

jog1t commented May 15, 2026

Merge activity

  • May 15, 7:36 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 15, 8:00 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 15, 8:00 PM UTC: @jog1t merged this pull request with Graphite.

@jog1t jog1t changed the base branch from 05-11-refactor_forntend_improve_providers_table to graphite-base/5034 May 15, 2026 19:57
@jog1t jog1t changed the base branch from graphite-base/5034 to main May 15, 2026 19:58
@jog1t jog1t force-pushed the 05-11-feat_frontend_add_provider_icons branch from a23259e to 8c2d5c7 Compare May 15, 2026 19:59
@jog1t jog1t merged commit 00c0e82 into main May 15, 2026
8 of 11 checks passed
@jog1t jog1t deleted the 05-11-feat_frontend_add_provider_icons branch May 15, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant