Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions lib/features/onboarding/welcome_tour_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ class KbdBadge extends StatelessWidget {
vertical: 2,
),
decoration: material.BoxDecoration(
color: isDark
? const material.Color(0xFF1E2024)
: const material.Color(0xFFF1F5F9),
color: wb.surface,
borderRadius: material.BorderRadius.circular(4),
border: material.Border.all(
color: wb.borderSubtle.withValues(alpha: 0.8),
),
boxShadow: [
material.BoxShadow(
color: material.Colors.black.withValues(alpha: isDark ? 0.3 : 0.08),
color: wb.shadow.withValues(alpha: isDark ? 0.3 : 0.08),
offset: const material.Offset(0, 1),
blurRadius: 1,
),
Expand Down Expand Up @@ -389,7 +387,7 @@ onPressed: _finish,
return _TourSlideView(
key: const ValueKey(0),
icon: material.Icons.hub_rounded,
iconColor: const material.Color(0xFF06B6D4), // Cyan
iconColor: wb.accent,
title: 'Connect in Seconds',
description:
'Connect directly to PostgreSQL, MySQL, SQLite, Redis, MongoDB or custom extension drivers. Paste a connection URL or use our visual form with real-time field validation.',
Expand All @@ -401,7 +399,7 @@ onPressed: _finish,
return _TourSlideView(
key: const ValueKey(1),
icon: material.Icons.view_sidebar_rounded,
iconColor: const material.Color(0xFF8B5CF6), // Purple
iconColor: cs.chart4,
title: 'Fluid Sidebar & Navigation',
description:
'Browse database schemas, tables, and views with full keyboard navigation. Right-click any object for instant SELECT queries and DDL copy.',
Expand All @@ -414,7 +412,7 @@ onPressed: _finish,
return _TourSlideView(
key: const ValueKey(2),
icon: material.Icons.code_rounded,
iconColor: const material.Color(0xFF3B82F6), // Blue
iconColor: cs.chart1,
title: 'Pro SQL Editor & Workspaces',
description:
'Execute scripts with $cmdCtrl+Enter or F5. Open multiple query tabs, format SQL with $cmdCtrl+Shift+F, and access persistent query history.',
Expand All @@ -427,7 +425,7 @@ onPressed: _finish,
return _TourSlideView(
key: const ValueKey(3),
icon: material.Icons.table_chart_rounded,
iconColor: const material.Color(0xFF10B981), // Emerald
iconColor: cs.chart2,
title: 'Interactive 2D Grid & DML Staging',
description:
'Edit cells in-place, select ranges with Shift+Click, and copy TSV data with $cmdCtrl+C. Staged changes are safely previewed with DML inspection before committing.',
Expand All @@ -440,7 +438,7 @@ onPressed: _finish,
return _TourSlideView(
key: const ValueKey(4),
icon: material.Icons.filter_alt_rounded,
iconColor: const material.Color(0xFFF59E0B), // Amber
iconColor: cs.chart3,
title: 'Compound Filter Bar & Quick Calc',
description:
'Filter grid results with live autocomplete expressions. Toggle Groupings & Pivot panels with $cmdCtrl+G and inspect instant stats (Sum, Avg, Median) in the status bar.',
Expand Down Expand Up @@ -634,13 +632,13 @@ class _HotkeysMatrixSlideView extends StatelessWidget {
width: 36,
height: 36,
decoration: material.BoxDecoration(
color: const material.Color(0xFFEC4899).withValues(alpha: 0.15),
color: context.colors.chart5.withValues(alpha: 0.15),
shape: material.BoxShape.circle,
),
child: const material.Icon(
child: material.Icon(
material.Icons.keyboard_rounded,
size: 20,
color: material.Color(0xFFEC4899),
color: context.colors.chart5,
),
),
const material.SizedBox(width: 12),
Expand Down
4 changes: 3 additions & 1 deletion lib/shared/widgets/app_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';

import 'package:querya_desktop/core/motion/querya_motion.dart';
import 'package:querya_desktop/core/motion/querya_motion_context.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';

/// Shows a modal dialog with a frosted, dimmed backdrop over the app.
///
Expand Down Expand Up @@ -153,7 +154,8 @@ class _DialogBackdrop extends StatelessWidget {
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: sigma, sigmaY: sigma),
child: ColoredBox(
color: const Color(0xFF000000).withValues(alpha: tintAlpha * t),
color: context.workbenchOrDefault.shadow
.withValues(alpha: tintAlpha * t),
),
),
);
Expand Down
15 changes: 4 additions & 11 deletions lib/shared/widgets/connection_environment_badge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,13 @@ material.Color environmentAccentColor(
ConnectionEnvironment.production => wb.destructive,
};

/// Like [environmentAccentColor], but falls back to fixed colors when no
/// [QueryaThemeScope] is mounted (isolated form / dialog tests).
/// Like [environmentAccentColor], but resolves from ambient theme or defaults
/// when no [QueryaThemeScope] is mounted (isolated form / dialog tests).
material.Color environmentAccentColorOf(
material.BuildContext context,
ConnectionEnvironment environment,
) {
final wb = QueryaThemeScope.maybeOf(context)?.workbench;
if (wb != null) return environmentAccentColor(wb, environment);
return switch (environment) {
ConnectionEnvironment.development => const material.Color(0xFF4CAF50),
ConnectionEnvironment.staging => const material.Color(0xFFF59E0B),
ConnectionEnvironment.production => const material.Color(0xFFEF4444),
};
}
) =>
environmentAccentColor(context.workbenchOrDefault, environment);

/// Background for window chrome (title / status bar) of a connection in
/// [environment]: [base] untouched for Development, tinted for the others.
Expand Down
9 changes: 2 additions & 7 deletions lib/shared/widgets/querya_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ class _QueryaButtonState extends material.State<QueryaButton> {
if (_pressed != value) setState(() => _pressed = value);
}

/// Black or white, whichever reads on [background].
static material.Color _onColor(material.Color background) =>
background.computeLuminance() > 0.5
? const material.Color(0xFF000000)
: const material.Color(0xFFFFFFFF);

@override
material.Widget build(material.BuildContext context) {
Expand All @@ -313,7 +308,7 @@ class _QueryaButtonState extends material.State<QueryaButton> {
// ---- colours -------------------------------------------------------
final material.Color foreground;
material.Color background;
var outline = const material.Color(0x00000000);
var outline = material.Colors.transparent;
if (filled) {
final base = w.variant == QueryaButtonVariant.primary
? wb.accent
Expand All @@ -326,7 +321,7 @@ class _QueryaButtonState extends material.State<QueryaButton> {
} else {
foreground = w.variant == QueryaButtonVariant.primary
? wb.onAccent
: _onColor(base);
: scheme.destructiveForeground;
final tint = _pressed && enabled
? 0.22
: (_hovered && enabled ? 0.12 : 0.0);
Expand Down
39 changes: 39 additions & 0 deletions test/features/onboarding/welcome_tour_dialog_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
import 'package:querya_desktop/core/motion/querya_motion_scope.dart';
import 'package:querya_desktop/core/storage/local_db.dart';
import 'package:querya_desktop/core/theme/querya_theme.dart';
import 'package:querya_desktop/features/onboarding/welcome_tour_dialog.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' hide TextExtension;

Expand Down Expand Up @@ -200,4 +201,42 @@ void main() {
Duration.zero,
);
});

testWidgets('slide icons and shortcut badges adapt to theme tokens (#1509)',
(tester) async {
const lightTheme = QueryaTheme.lightDefault;
await tester.pumpWidget(
queryaThemeTestShell(
data: lightTheme,
child: const material.Scaffold(
body: WelcomeTourDialog(),
),
),
);
await tester.pumpAndSettle();

// Slide 1: Connect in Seconds icon uses lightTheme.workbench.accent
final hubIconFinder = find.byIcon(material.Icons.hub_rounded);
expect(hubIconFinder, findsOneWidget);
final hubIcon = tester.widget<material.Icon>(hubIconFinder);
expect(hubIcon.color, lightTheme.workbench.accent);

// KbdBadge uses lightTheme.workbench.surface
final containerFinder = find.ancestor(
of: find.text('N'),
matching: find.byType(material.Container),
);
final keycapContainer = tester.widget<material.Container>(containerFinder.first);
final boxDecoration = keycapContainer.decoration! as material.BoxDecoration;
expect(boxDecoration.color, lightTheme.workbench.surface);

// Next -> Slide 2: Fluid Sidebar uses lightTheme.colorScheme.chart4
await tester.tap(find.byKey(const Key('welcome_tour_next_button')));
await tester.pumpAndSettle();

final sidebarIconFinder = find.byIcon(material.Icons.view_sidebar_rounded);
expect(sidebarIconFinder, findsOneWidget);
final sidebarIcon = tester.widget<material.Icon>(sidebarIconFinder);
expect(sidebarIcon.color, lightTheme.colorScheme.chart4);
});
}
Loading