mirror of
https://github.com/block/buzz.git
synced 2026-10-27 04:30:52 +00:00
## Summary - Restores `#` and lock icons for public and private channels on Home, with matching loading placeholders. - Updates the dark-mode navigation colors to the desktop design-system tokens (read and unread text, section headings). - Replaces the chat color picker with the seven desktop accents (Gray, Chartreuse, Flame, Magenta, Iris, Cobalt, Jade). Saved legacy colors map to the closest one. - Uses white text in your own bubbles, and black where white falls below 4.5:1 (Chartreuse, dark-mode Gray). Links (underlined), quotes, tables and code use the same text color. - Insets code blocks in bubbles evenly, with corners concentric to the bubble and even inner padding. - The swipe-to-reply indicator uses the chosen chat color. ## Testing - `flutter analyze` and `dart format` are clean. The full mobile suite passes (3,705 tests). - Installed and checked on a Pixel 10 and an iPhone Air against a real community. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Queue <874bf2d815c2c4b459b90438c669c57f2702f3a76bb6e16fa97184259aac3e9e@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
1.9 KiB
Dart
59 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'chat_colors.dart';
|
|
import 'color_scheme.dart';
|
|
import 'app_theme.dart';
|
|
|
|
/// Chat-only colors, independent of controls and navigation.
|
|
@immutable
|
|
class ChatColors extends ThemeExtension<ChatColors> {
|
|
/// Creates the outgoing message palette.
|
|
const ChatColors({required this.outgoing, required this.foreground});
|
|
|
|
/// Fill for messages authored by the active signing identity.
|
|
final Color outgoing;
|
|
|
|
/// Desktop text color paired with the outgoing fill.
|
|
final Color foreground;
|
|
|
|
/// Reads chat colors while supporting isolated widget previews.
|
|
static ChatColors of(BuildContext context) =>
|
|
Theme.of(context).extension<ChatColors>() ??
|
|
ChatColors(
|
|
outgoing: Theme.of(context).colorScheme.primary,
|
|
foreground: contrastForeground(Theme.of(context).colorScheme.primary),
|
|
);
|
|
|
|
@override
|
|
ChatColors copyWith({Color? outgoing, Color? foreground}) => ChatColors(
|
|
outgoing: outgoing ?? this.outgoing,
|
|
foreground: foreground ?? this.foreground,
|
|
);
|
|
|
|
@override
|
|
ChatColors lerp(covariant ChatColors? other, double t) => other == null
|
|
? this
|
|
: ChatColors(
|
|
outgoing: Color.lerp(outgoing, other.outgoing, t)!,
|
|
foreground: Color.lerp(foreground, other.foreground, t)!,
|
|
);
|
|
}
|
|
|
|
/// Builds the single mobile palette. Legacy theme names remain readable for
|
|
/// community preference compatibility, but never select an application palette.
|
|
ThemeData mobileAppearanceTheme(Brightness brightness, String chatColor) {
|
|
final theme = brightness == Brightness.dark
|
|
? AppTheme.dark()
|
|
: AppTheme.light();
|
|
final index = chatColorIndex(chatColor);
|
|
return theme.copyWith(
|
|
extensions: [
|
|
...theme.extensions.values,
|
|
ChatColors(
|
|
outgoing: chatColorForScheme(theme.colorScheme, index),
|
|
foreground: chatForegroundForScheme(theme.colorScheme, index),
|
|
),
|
|
],
|
|
);
|
|
}
|