Presentation fixes: - Mirror the in-progress pen/highlighter stroke to the audience window live (new 'inkLive' channel) so highlights appear as they are drawn, not only after the pen lifts. - Cover the macOS menu bar on the beamer: raise the audience window above .mainMenu level so the Apple/Wi-Fi strip no longer shows during a presentation. Styling no longer lives in the file: - generateDeck no longer embeds the ThemeProfile; a saved .md holds only content. The profile is inlined only for the transient audience-window payload (inlineStyleProfile: true), never to disk. - On open, the app applies the active style profile (FileService.openDeck / activeProfileFor, DeckNotifier.loadDeck); applyMarkdown preserves the current profile. Quality pass / tests green: - Complete the consent-screen translations (English plus 7 missing strings per other language). - Pass the consent gate in widget/ui-scale tests by seeding the consent key, so the app shell renders. - Update markdown round-trip tests for the new default and add coverage for live stroke streaming and styling-free saves. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
66 lines
2.2 KiB
Dart
66 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:ocideck/app.dart';
|
|
import 'package:ocideck/models/slide.dart';
|
|
import 'package:ocideck/state/settings_provider.dart';
|
|
import 'package:ocideck/widgets/app_shell.dart';
|
|
import 'package:ocideck/widgets/slides/slide_preview.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
void main() {
|
|
testWidgets('the interface text-scale setting scales the editor UI', (
|
|
tester,
|
|
) async {
|
|
SharedPreferences.setMockInitialValues({'app_consent_accepted': true});
|
|
await tester.pumpWidget(const ProviderScope(child: OciDeckApp()));
|
|
await tester.pumpAndSettle();
|
|
final container = ProviderScope.containerOf(
|
|
tester.element(find.byType(AppShell)),
|
|
);
|
|
|
|
TextScaler scalerAtShell() =>
|
|
MediaQuery.textScalerOf(tester.element(find.byType(AppShell)));
|
|
expect(scalerAtShell().scale(10), 10);
|
|
|
|
await container.read(settingsProvider.notifier).setUiTextScale(1.5);
|
|
await tester.pump();
|
|
expect(scalerAtShell().scale(10), 15);
|
|
|
|
// The setting is clamped to WCAG's 200%.
|
|
await container.read(settingsProvider.notifier).setUiTextScale(5.0);
|
|
await tester.pump();
|
|
expect(scalerAtShell().scale(10), 20);
|
|
});
|
|
|
|
testWidgets('the slide canvas opts out of text scaling', (tester) async {
|
|
final slide = Slide.create(
|
|
SlideType.bullets,
|
|
).copyWith(title: 'Titel', bullets: const ['Punt een']);
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
builder: (context, child) => MediaQuery(
|
|
data: MediaQuery.of(
|
|
context,
|
|
).copyWith(textScaler: const TextScaler.linear(2)),
|
|
child: child!,
|
|
),
|
|
home: Scaffold(
|
|
body: SizedBox(
|
|
width: 800,
|
|
height: 450,
|
|
child: SlidePreviewWidget(slide: slide),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.pump();
|
|
|
|
// The slide is a fixed design surface: its text must render unscaled so
|
|
// the auto-fit measuring stays truthful.
|
|
final inSlide = MediaQuery.textScalerOf(
|
|
tester.element(find.text('Punt een')),
|
|
);
|
|
expect(inSlide.scale(10), 10);
|
|
});
|
|
}
|