Skip to content

[MBL-19905] InstUI icons#4008

Open
vargaat wants to merge 5 commits into
masterfrom
feature/MBL-19905-InstUI-icons
Open

[MBL-19905] InstUI icons#4008
vargaat wants to merge 5 commits into
masterfrom
feature/MBL-19905-InstUI-icons

Conversation

@vargaat
Copy link
Copy Markdown
Collaborator

@vargaat vargaat commented Apr 23, 2026

  • Added custom InstUI and Lucid icons (with license file) to build-instui script.
  • ~1800 icons in total, 2.8 MB added to total bundle size.
  • SwiftUI.Image extension for all icons.
  • Storybook support.

PR Review Guide

This PR is large due to the generated asset catalog (1,780 SVG imagesets). The files below are the only non-generated, reviewable changes. Asset catalog files under packages/InstUI/Resources/Icons.xcassets/ can be ignored for review purposes.


Build script

scripts/instui/build-icons.js

New script that drives the icon import pipeline. On each run it clears and rebuilds Icons.xcassets with SVGs from two sources: Lucide 1.8.0 (1,695 icons, no suffix) and the instructure-ui Custom/ subdirectory (85 icons, Custom suffix appended only on the two names that conflict with Lucide). SVGs are color-normalized to a template placeholder color (#D852BE) so they render as tintable template images in iOS. Icons already at 24×24 viewBox pass through without a scale transform; 1920-unit icons are scaled down. Generates InstUI.Icons.swift as a side effect.

scripts/instui/build-instui.js

One-line change: calls buildIcons(INSTUI_VERSION) as the first step of the existing yarn build-instui pipeline so icons are always rebuilt alongside tokens.


InstUI Swift package

packages/InstUI/Sources/Icon/InstUI+IconNamespace.swift

Declares extension Image { public enum iui {} } — the static namespace that all generated icon accessors hang off. This file is never overwritten by the build script.

packages/InstUI/Sources/Icon/Generated/InstUI.Icons.swift

Auto-generated by yarn build-instui (do not edit). Adds public static var name: Image accessors on Image.iui for all 1,780 icons, plus an internal all: [(name: String, image: Image)] array used by the Storybook to iterate every icon without a runtime asset catalog enumeration API.

packages/InstUI/Sources/Icon/Storybook/InstUI.Icons.Storybook.swift

Adds Image.iui.Storybook — a LazyVGrid view that renders all icons from the all array with their names, following the same layout pattern as the existing InstUI.Primitive.Color.Storybook.

packages/InstUI/Sources/InstUI.Storybook.swift

Adds an Icons section to the top-level InstUI.Storybook list that navigates to Image.iui.Storybook.


License

packages/InstUI/Resources/LICENSE-lucide

ISC license for the Lucide icon set, copied verbatim from the Lucide 1.8.0 release and refreshed automatically on every yarn build-instui run.

PR Info

refs: MBL-19905
builds: Student, Teacher, Parent
affects: Student, Teacher, Parent
release note: none

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

PR Checks

Commit: Merge branch 'master' into feature/MBL-19905-InstUI-icons (6b3600e)
Built At: Apr 30 09:25 UTC (04/30 03:25 AM MDT)

✅ PR Description
✅ Copyright Headers
✅ SwiftLint
✅ Build CITests
✅ Unit Tests
✅ Code Coverage

@bitrise
Copy link
Copy Markdown
Contributor

bitrise Bot commented Apr 23, 2026

Builds

Commit: Merge branch 'master' into feature/MBL-19905-InstUI-icons (6b3600e)
Build Number: 1922
Built At: Apr 30 11:29 CEST (04/30 03:29 AM MDT)

Student
Teacher
Parent

Copy link
Copy Markdown
Contributor

@petkybenedek petkybenedek left a comment

Choose a reason for hiding this comment

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

There's an extra tab on packages/InstUI/Sources/Icon/Storybook/InstUI.Icons.Storybook.swift line 52
Okay otherwise

petkybenedek
petkybenedek previously approved these changes Apr 27, 2026
rh12
rh12 previously approved these changes Apr 27, 2026
Copy link
Copy Markdown
Contributor

@rh12 rh12 left a comment

Choose a reason for hiding this comment

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

QA + 1

As discussed:

  • make them static let (requires namespace to be created in generated file)
  • remove backticks inside the all items

Future storybook improvements:

  • filter (same suggestion for colors)
  • side index list ?
  • dynamic scaling ?
  • size setting ?

@rh12 rh12 dismissed stale reviews from petkybenedek and themself via 6b3600e April 30, 2026 09:07
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.

4 participants