Skip to content

feat: custom theme system with brand color and font support#75

Open
johnboyle5 wants to merge 71 commits into
soliplex:mainfrom
johnboyle5:custom-theme
Open

feat: custom theme system with brand color and font support#75
johnboyle5 wants to merge 71 commits into
soliplex:mainfrom
johnboyle5:custom-theme

Conversation

@johnboyle5
Copy link
Copy Markdown

Summary

Replaces the ad-hoc theming with a configurable design system supporting white-label color and font customization, light/dark mode switching, and a comprehensive component theme. Includes responsive AppBar title styling, square borders throughout, and migration of hardcoded values to design tokens.

Highlights

Theming Infrastructure

  • New ColorConfig / ColorPalette model for runtime brand color customization (7 required + 6 optional roles, with auto-computed contrast colors)
  • New FontConfig with bodyFont, displayFont, brandFont, and codeFont roles
  • ShellConfig now accepts darkTheme and themeMode; light/dark switching via themeModeProvider (Riverpod + SharedPreferences persistence)
  • SoliplexTheme extension exposes color scheme, radii, badge theme, and code font helpers

Design Tokens

  • Spacing: s1s9 (4–48)
  • Radii, breakpoints, typography tokens
  • Bundled Inter variable font
  • Configurable monospace font with platform-adaptive fallback (SF Mono on Apple, Roboto Mono elsewhere)

Theme Toggle

  • ThemeToggleButton widget for switching light/dark/system modes
  • Wired into thread sidebar, server sidebar, room info, network inspector, and server list AppBars

John Boyle added 30 commits April 6, 2026 11:47
Add Inter variable font (bundled asset), google_fonts and meta packages.
Include HYPRSALVO, OPERATORZ, and TACTICAL display fonts.
Introduce design system with color palettes, typography tokens, spacing,
radii, breakpoints, and theme builder functions for light/dark modes.
Add ColorConfig, FontConfig, and ThemeConfig models.
Add Riverpod themeModeProvider with SharedPreferences persistence
and a ThemeToggleButton widget for switching light/dark/system modes.
Wire dark theme support and theme mode switching into ShellConfig and
the shell widget. Update standard flavor to use new theme builders
and export design system from the library barrel file.
Add implementation guide, change summary, and theme port journal
documenting the design system and theming architecture.
# Conflicts:
#	lib/src/design/color/color_scheme_extensions.dart
#	lib/src/design/design.dart
#	lib/src/design/theme/theme.dart
#	lib/src/design/theme/theme_extensions.dart
#	lib/src/design/tokens/radii.dart
#	lib/src/design/tokens/typography.dart
#	lib/src/design/tokens/typography_x.dart
#	lib/src/flavors/standard.dart
#	pubspec.lock
#	pubspec.yaml
Place ThemeToggleButton in AppBar actions for room info, network
inspector, and server list screens. Add toggle to thread and server
sidebars with improved spacing and icon consistency.
Add ProviderScope to all widget tests that render ThemeToggleButton.
Rewrite theme_test for new ColorConfig/ColorPalette API with HTTP
override to prevent google_fonts network calls. Use specific icon
finders in network inspector tests to avoid ambiguity.
Replace magic numbers with SoliplexSpacing constants in ListTileTheme.
Normalize hex color casing and adjust outline colors for better contrast.
Use theme.colorScheme.error instead of Colors.red in auth callback
screen, and theme.colorScheme.outline instead of Colors.grey in
SVG error builder.
Add codeFont to FontConfig for runtime monospace font customization.
Store configured font in SoliplexTheme extension and provide
mergeCode/codeStyle/resolveCodeFontFamily helpers. Replace all
hardcoded 'monospace', 'SF Mono', and 'Roboto Mono' strings across
16 files with the new theme-aware API.
Remove all border radius rounding from component themes. Update card
theme with flat background, no shadow, zero margin, and bottom-only
outlineVariant border. Adjust divider alpha and list tile styling.
Add s7 (28), s8 (32), s9 (48) spacing tokens. Bump headline and
title font weights to w600-w700 and increase headline font sizes.
Add underlined heading with headlineLarge style in server section.
Use spacing tokens throughout lobby screen and room card. Simplify
server sidebar action buttons and fix overflow with Expanded text.
Set all FAB elevation states to 0 and remove per-instance elevation
override on scroll-to-bottom button.
Use CrossAxisAlignment.stretch with Alignment.centerLeft on action
buttons. Update network inspector icon to Icons.lan in both sidebars.
Replace hardcoded spacing values with SoliplexSpacing tokens in
message tiles, timeline, and room welcome. Use headlineLarge for
room name and surface color for assistant message background.
Remove BorderRadius.circular from inline code, code blocks, badges,
banners, containers, headers table, and message bubbles. Reduce
button font weights from w700 to w600. Adjust list tile padding.
Use smaller padding on mobile and adjust chat input and thread
sidebar spacing to match.
Wrap thread sidebar in SafeArea for proper status bar inset on iOS.
Use SoliplexBreakpoints.tablet for wide layout breakpoints in lobby
and room screens. Match Lobby button color to sidebar heading text.
John Boyle added 30 commits April 9, 2026 10:37
Align the two custom-theme docs with the current state of the branch:
drop churn-prone line counts and diff stats, bump the pinned
google_fonts version to ^8.0.2, and add sections covering the
SoliplexSpacing/SoliplexRadii/SoliplexBreakpoints token values,
the macOS FLTEnableMergedPlatformUIThread workaround, the square-first
border decision, unused bundled font assets, and an accurate
description of typography_x.dart.
The two concurrency-event tests that came in from the latest main merge
assumed a single-IconButton AppBar with no Riverpod consumer. After the
merge kept the ThemeToggleButton in the AppBar, they failed with
'No ProviderScope found' and an ambiguous IconButton finder. Wrap their
pumpWidget calls in ProviderScope and scope the finders via
widgetWithIcon(IconButton, Icons.delete_outline) and
byTooltip('Clear all requests'), matching the pattern the other tests
in this file already use.
# Conflicts:
#	ios/Podfile.lock
#	lib/soliplex_frontend.dart
#	lib/src/flavors/standard.dart
#	lib/src/modules/auth/ui/auth_callback_screen.dart
#	lib/src/modules/auth/ui/home_screen.dart
#	lib/src/modules/lobby/ui/lobby_screen.dart
#	lib/src/modules/quiz/ui/quiz_screen.dart
#	lib/src/modules/room/ui/room_screen.dart
#	lib/src/modules/room/ui/thread_sidebar.dart
#	macos/Podfile.lock
#	pubspec.yaml
#	test/modules/lobby/ui/server_sidebar_test.dart
#	test/modules/room/ui/thread_sidebar_quiz_row_test.dart
Drop the custom InlineCodeBuilder, which inserted a Container chip into
flutter_markdown_plus's Wrap layout and broke per-row baseline alignment
(text after a chip appeared shifted; soft-wraps split the wrong way).
Inline code now flows as part of the surrounding RichText with a tinted
backgroundColor on the code TextStyle.

Use an alphaBlend(onSurface, surface) tint instead of surfaceContainerHigh
so the chip reads as a subtle darker tint in light mode and a subtle
lighter tint in dark mode.
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