Files
buzz/mobile/test/shared/theme/mobile_appearance_test.dart
klopez4212 5fefec604f fix(mobile): restore channel icons and align chat colors with desktop (#8478)
## 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>
2026-10-20 13:48:12 -04:00

35 lines
1.6 KiB
Dart

import 'package:buzz/shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
test('desktop surface and text roles match in both modes', () {
final light = mobileAppearanceTheme(Brightness.light, 'neutral');
final dark = mobileAppearanceTheme(Brightness.dark, 'neutral');
expect(light.colorScheme.surface, const Color(0xFFFFFFFF));
expect(light.colorScheme.onSurface, const Color(0xFF0A0A0A));
expect(light.colorScheme.onSurfaceVariant, const Color(0xFF646464));
expect(light.colorScheme.outline, const Color(0xFFE8E8E8));
expect(dark.colorScheme.surface, const Color(0xFF000000));
expect(dark.colorScheme.onSurface, const Color(0xFFFFFFFF));
expect(dark.colorScheme.onSurfaceVariant, const Color(0xFFC7C7C7));
expect(dark.colorScheme.outline, const Color(0xFF1A1A1A));
});
for (final brightness in Brightness.values) {
test('chat colors do not recolor controls in $brightness', () {
final base = mobileAppearanceTheme(brightness, 'neutral');
for (final accent in accentColors) {
final theme = mobileAppearanceTheme(brightness, accent.wireValue);
expect(theme.colorScheme, base.colorScheme);
final fill = theme.extension<ChatColors>()!.outgoing;
final foreground = theme.extension<ChatColors>()!.foreground;
final a = fill.computeLuminance();
final b = foreground.computeLuminance();
final ratio = a > b ? (a + .05) / (b + .05) : (b + .05) / (a + .05);
expect(ratio, greaterThanOrEqualTo(4.5));
}
});
}
}