Skip to content

[MBL-19926][Student] InstUI Design System Foundation#3650

Merged
hermannakos merged 12 commits intomasterfrom
MBL-19926-instui-preparation
Apr 22, 2026
Merged

[MBL-19926][Student] InstUI Design System Foundation#3650
hermannakos merged 12 commits intomasterfrom
MBL-19926-instui-preparation

Conversation

@hermannakos
Copy link
Copy Markdown
Collaborator

Summary

Introduces the libs/instui module — a design token system and initial Compose component library for the InstUI design system, synced with instructure-ui (web).

Token Generation (3 layers, auto-generated from instructure-ui v11.7.1)

  • Primitives — colors, sizes, font weights, font families, opacities
  • Semantics — theme-aware light/dark colors, layout sizes, typography, elevation
  • Components — 65 per-component token files (Text, Heading, Button, Pill, List, etc.) with composed TextStyle objects, @Composable color accessors, and sp font sizes

Compose Components (hand-written, thin wrappers)

  • InstUITheme — MaterialTheme wrapper with InstUI defaults
  • Text / Heading — typography composables using generated TextStyles
  • Pill — status badge with 5 variants (Default, Info, Error, Success, Warning)
  • ListItem — leading/content/trailing/bottom slot layout
  • SectionHeader — collapsible header with trailing slot
  • Separator — themed horizontal divider
  • Card — elevated surface with token-based border radius and padding
  • TopBar — navigation bar with title, subtitle, and icon slots
  • GradesScreenPreview — dummy preview assembling all components per Figma spec

Other

  • BorderStyle enum mapping CSS border styles to Compose PathEffect
  • Font files: Atkinson Hyperlegible Next, Inclusive Sans, Lato
  • NGC added to translation projects

Test plan

  1. Open libs/instui in Android Studio
  2. Run Compose Previews in Text.kt, Pill.kt, Card.kt, ListItem.kt, SectionHeader.kt, TopBar.kt
  3. Verify light and dark mode previews render correctly
  4. Open GradesScreenPreview.kt and verify the full Grades screen preview matches the Figma design
  5. Run ./gradlew :instui:compileDebugKotlin — should pass
  6. Run cd libs/instui/scripts && npm install && npm run build — should regenerate all token files
  • Tested in dark mode
  • Tested in light mode
  • A11y checked

refs: MBL-19926
affects: Student
release note: none (foundation work, no user-facing changes)

tamaskozmer and others added 8 commits April 14, 2026 09:42
Extend the InstUI token generator to produce the third layer: per-component
design tokens from instructure-ui's rebrand/component/*.json files (65 files).

Component tokens reference the semantic layer and provide:
- Composed TextStyle objects with sp font sizes and em/sp line heights
- Color tokens as @composable getters delegating to semantic accessors
- Font sizes always in sp for Compose accessibility correctness
- BorderStyle enum mapping CSS border styles to Compose PathEffect
- BoxShadow and Border composites as documentation comments

CSS-specific values (currentColor, percentages, multi-value shorthands) are
commented out as not directly usable in Compose.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
InstUILayoutTypography.FontSize values now emit sp units (e.g., 16.sp)
instead of referencing InstUISizes (which are dp). This ensures font
sizes respect the user's accessibility text scaling preference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the first hand-written Compose components for the InstUI design system:
- InstUITheme: MaterialTheme wrapper providing InstUI default text style
  and content color (theme-aware via semantic tokens)
- Text: drop-in for Material3 Text with InstUI typography defaults
- Heading: heading composable mapping H1-H6 to generated TextStyles
- Light/dark preview configurations for all components

Also adds Material3 and Compose tooling preview dependencies to the
instui module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move generated tokens under token/ package (primitives, semantic, component)
to separate them from hand-written compose/ code.

Add Compose components for the Grades feature:
- Pill: status badge with 5 variants (Default, Info, Error, Success, Warning)
- ListItem: slots for leading, content, trailing, and bottom areas
- SectionHeader: collapsible header with trailing slot for chevron
- Separator: themed horizontal divider
- Card: elevated surface with configurable padding and border
- TopBar: navigation bar with title, subtitle, and icon slots

Fix ListItem title to use heading style (Inclusive Sans) with theme-aware
color. Fix Card padding to 12dp matching Figma. Fix TopBar subtitle to
12sp (legend style).

Add GradesScreenPreview demonstrating all components together matching
the Figma "AM Grades" design.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1210 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 790 total, 0 failed, 0 skipped
  • Duration: 36.380s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3408 total, 0 failed, 0 skipped
  • Duration: 57.931s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 5408
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Wed, 22 Apr 2026 08:40:52 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.61%
  • Master Coverage: 42.61%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.31%
  • Master Coverage: 25.31%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 23.88%
  • Master Coverage: 23.88%
  • Delta: +0.00%

📈 Overall Average

  • PR Coverage: 30.60%
  • Master Coverage: 30.60%
  • Delta: +0.00%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

Student Install Page

Add icon generator that fetches SVGs from instructure-ui and produces
Compose ImageVector extension properties on InstUIIcons.Line/Solid/Custom.

- 386 Line icons, 386 Solid icons, 85 Custom icons
- Delta sync via SHA manifest (icons-manifest.json) — subsequent runs
  only download changed files
- Multi-path SVGs supported (e.g., aI-info.svg with 3 paths)
- SVG path data parsed at runtime via PathParser (lazy initialization)

Update GradesScreenPreview to use real InstUI icons (ArrowLeft, Lock,
ArrowOpenDown/Up, Assignment, More) instead of placeholders.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kristofnemere kristofnemere self-requested a review April 20, 2026 10:31
ListItem: replace generic subtitle/bottom slots with explicit named
parameters matching the Figma structure — supportingText, subtext1,
subtext2, pill composable slot, and score composable slot.

Pill: accept ImageVector instead of composable slot for the icon.
The Pill now handles icon sizing (14dp) and tinting (matches variant
text color) automatically, simplifying call sites.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread libs/instui/build.gradle.kts
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/container/Card.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/indicator/Pill.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/list/SectionHeader.kt Outdated
Comment thread libs/instui/scripts/build-instui-icons.js
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/indicator/Pill.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/list/ListItem.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/list/SectionHeader.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/navigation/TopBar.kt Outdated
Comment thread libs/instui/src/main/java/com/instructure/instui/compose/indicator/Pill.kt Outdated
hermannakos and others added 2 commits April 21, 2026 14:02
P0 fixes:
- Card: replace Column with Box to prevent LazyColumn crash
- Add proguard-rules.pro and consumer-rules.pro

P1 fixes:
- Pill: refactor variant when() to enum-with-properties pattern
  (PillColors data class + composable lambda per variant)
- Pill: extract TextStyle to top-level constant (avoid recomposition alloc)
- SectionHeader: replace hardcoded 16.dp/8.dp with token references
- SectionHeader: extract TextStyle to top-level constant
- TopBar: subtitle contentColor uses Text.inverse() token
- Icons: add autoMirror=true for directional icons (arrow, back, etc.)
- Icons: add @Preview to each generated icon file

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add InstUI Icon composable with token-based IconSize enum (XSmall–XXLarge)
and IconColor enum (Base, Muted, Error, etc.) with composable lambdas.
Two overloads: one with IconColor enum, one with explicit Color tint.

Refactor ListItem to mirror Figma component structure:
- Leading: sealed class with Icon, Radio, Checkbox, Avatar modes
- Trailing: sealed class with Icons, Checkbox, Switch, TextOnly, Accordion modes
- Content: add missing text slot (body text between title and subtexts)
- Fix padding to 12dp all sides (SpaceMd) and 16dp gap (SpaceLg)

Refactor SectionHeader to match Figma:
- Built-in chevron icon (ArrowOpenDown) with rotation based on expanded state
- Replace generic trailing slot with expanded: Boolean parameter
- Rename title to label per Figma naming

Update all components and previews to use InstUI Icon instead of M3 Icon.
Add previews showing all leading/trailing modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hermannakos hermannakos merged commit fe93707 into master Apr 22, 2026
69 of 72 checks passed
@hermannakos hermannakos deleted the MBL-19926-instui-preparation branch April 22, 2026 08:55
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.

3 participants