Skip to content

[Refactor] - Standardize design system tokens and enhance widget UI/UX#111

Draft
InduwaraSMPN wants to merge 19 commits intodevfrom
design-system-enhancements
Draft

[Refactor] - Standardize design system tokens and enhance widget UI/UX#111
InduwaraSMPN wants to merge 19 commits intodevfrom
design-system-enhancements

Conversation

@InduwaraSMPN
Copy link
Copy Markdown
Contributor

@InduwaraSMPN InduwaraSMPN commented Apr 29, 2026

Summary

This PR implements a comprehensive overhaul of the widget's design system to improve visual consistency, maintainability, and user experience. The changes transition the codebase from hardcoded styles to a centralized, token-based architecture.

Key Changes:

  • Design System Standardization:
    • Introduced component-tokens.ts to centralize logic for elevation (shadows), border-radius, and text tones.
    • Unified Flex, Stack, and Surface primitives to support shared layout props (padding presets, radius tokens, and elevation).
    • Expanded Text and Button components with new variants (chip, tab, inline, toolbar) and semantic sizes.
  • UI/UX Enhancements:
    • Implemented staggered entrance animations for the HomeView and chat messages.
    • Added a CSS-based typing indicator for "thinking" states.
    • Improved micro-interactions, including scale transforms on button presses and backdrop blurs for headers.
    • Enhanced SuggestedActions with icons and improved hover/active states.
  • Theming & Semantic Tokens:
    • Migrated notification styles and input borders to use CSS variables and semantic tokens, facilitating better support for High Contrast and Dark modes.
    • Updated color contrast logic for primary/accent colors.
  • System & Build:
    • Widget Defaults: Updated index.html with fallback widget IDs and API hosts to ensure functional defaults when query parameters are absent.
    • Build Optimization: Adjusted vite.config.ts to disable code splitting, ensuring the widget is bundled as a single library file for easier integration.

Related issue

Resolves #design-system-consistency

Test plan

  1. Load the widget without mtx-id params to verify fallback default settings.
  2. Navigate between Home, Chat, and Help views to verify staggered entrance animations.
  3. Trigger a "thinking" response from the agent to verify the new typing indicator animation.
  4. Verify Button and IconButton states (hover, active, disabled) across different variants.
  5. Check build output to ensure a single .js and .css bundle is generated without internal chunks.

Checklist

  • CI passes (type-check + lint)
  • Shared contracts in sync if changed (routes.ts, schema.ts, proto)

Induwara added 18 commits March 22, 2026 21:54
unifies elevation, radius, padding, and tone props across ui primitives by introducing shared
design tokens and utility classes; updates component apis for flexibility and consistency,
removes shadow constants from usage, and simplifies styling overrides for easier theme
maintenance and visual consistency
@InduwaraSMPN InduwaraSMPN changed the title fix: update config and add repository guidelines in AGENTS.md [Refactor] - Standardize design system tokens and enhance widget UI/UX Apr 29, 2026
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.

2 participants