From 453174bc2de4e3a12efd1c23aed601614f43986b Mon Sep 17 00:00:00 2001 From: Stuart Cameron Date: Sat, 28 Nov 2026 19:36:27 +1100 Subject: [PATCH] feat(app): NEW badges for AV1, v210 and the preview view-mode control (task #133) Things added in 1.8.0 outside the filter schemas had no NEW badge. They now take hard-coded stamps, read through WhatsNewService.isNew like CropDetectPanel's and AddonsSettingsTab's: - VideoCodec.sinceAppVersion: AV1 and v210 = 1.8.0. Badges their radios (disabled ones too), the Video Codec heading, the Output tab label and the toolbar's Settings button (SettingsDialog.isOutputTabNew / hasNew, which the Settings button now reads instead of the Add-ons stamp alone). - ComparisonViewMode.sinceAppVersion = 1.8.0: badges the preview's Original / Split / Processed control. - NewCornerBadge: the overlaid corner badge, shared by the Add-ons and Output tab labels, Crop Detect and the view-mode control. new_badges_outside_schemas_test.dart pins the stamps and checks the badges on an upgrade, a fresh install and the next feature release, pumping the real Settings dialog and preview widget. FILTER_SCHEMA.md and CLAUDE.md document stamps outside the schemas. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 6 +- app/lib/models/video_job.dart | 9 + app/lib/views/main_window.dart | 9 +- .../pass_settings/crop_detect_panel.dart | 11 +- .../views/settings/addons_settings_tab.dart | 11 +- app/lib/views/settings/settings_dialog.dart | 54 +++- app/lib/widgets/before_after_comparison.dart | 9 + app/lib/widgets/comparison_view_mode.dart | 4 + app/lib/widgets/new_badge.dart | 24 ++ app/test/new_badges_outside_schemas_test.dart | 264 ++++++++++++++++++ docs/FILTER_SCHEMA.md | 17 ++ 11 files changed, 388 insertions(+), 30 deletions(-) create mode 100644 app/test/new_badges_outside_schemas_test.dart diff --git a/CLAUDE.md b/CLAUDE.md index dcd23feb..1ba6305b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -779,7 +779,11 @@ in [docs/FILTER_SCHEMA.md](docs/FILTER_SCHEMA.md). **Stamp only what is new** (the option, not the parameter it was added to; never a hidden parameter): every control leading to it badges automatically — its dropdown, the switch that reveals it, its section, the pass row, and for a new Settings tab the -Settings button. +Settings button. Things outside the schemas take a hard-coded stamp: a codec +`VideoCodec.sinceAppVersion` (badging its radio, the Video Codec heading, the +Output tab and the Settings button through `SettingsDialog.isOutputTabNew` / +`hasNew`), other UI a `static const sinceAppVersion` (`AddonsSettingsTab`, +`CropDetectPanel`, `ComparisonViewMode`); see FILTER_SCHEMA.md. Several ongoing rules for schemas and the panel that renders them, each guarded by `filter_schema_curation_test.dart` unless noted — see diff --git a/app/lib/models/video_job.dart b/app/lib/models/video_job.dart index d3e85835..6adf1ae2 100644 --- a/app/lib/models/video_job.dart +++ b/app/lib/models/video_job.dart @@ -249,6 +249,15 @@ enum VideoCodec { final String value; final String displayName; + /// The app version this codec was first offered in, for its NEW badge in + /// Settings → Output (`WhatsNewService.isNew`). Null for every codec that + /// shipped before codecs had stamps. Never change a shipped value: stamp + /// a new codec in the change that adds it. + String? get sinceAppVersion => switch (this) { + VideoCodec.av1 || VideoCodec.v210 => '1.8.0', + _ => null, + }; + String get description { switch (this) { case VideoCodec.h264: diff --git a/app/lib/views/main_window.dart b/app/lib/views/main_window.dart index 2c4df96f..86687eae 100644 --- a/app/lib/views/main_window.dart +++ b/app/lib/views/main_window.dart @@ -32,8 +32,6 @@ import 'queue_panel.dart'; import 'settings/settings_dialog.dart'; import '../widgets/resizable_split.dart'; import '../widgets/warning_banner.dart'; -import '../services/whats_new_service.dart'; -import 'settings/addons_settings_tab.dart'; class MainWindow extends StatelessWidget { const MainWindow({super.key}); @@ -415,11 +413,10 @@ class MainWindow extends StatelessWidget { // Settings button — About and bug reporting live in its General tab IconButton( - // Marked in the NEW badge's colour while a Settings tab is new, so - // the badge inside is not the only way to find it. + // Marked in the NEW badge's colour while a Settings tab holds + // something new, so the badge inside is not the only way to find it. icon: Badge( - isLabelVisible: - WhatsNewService.instance.isNew(AddonsSettingsTab.sinceAppVersion), + isLabelVisible: SettingsDialog.hasNew, smallSize: 8, backgroundColor: Theme.of(context).colorScheme.tertiary, child: const Icon(Icons.settings), diff --git a/app/lib/views/pass_settings/crop_detect_panel.dart b/app/lib/views/pass_settings/crop_detect_panel.dart index 684571a9..b877e30d 100644 --- a/app/lib/views/pass_settings/crop_detect_panel.dart +++ b/app/lib/views/pass_settings/crop_detect_panel.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import '../../models/crop_detect_report.dart'; import '../../services/whats_new_service.dart'; import '../../viewmodels/main_viewmodel.dart'; +import '../../widgets/new_badge.dart'; import '../../widgets/warning_banner.dart'; /// Crop & Resize's Detect (app 1.7.0): measures the selected video's black @@ -24,17 +25,11 @@ class CropDetectPanel extends StatelessWidget { final report = viewModel.cropReport; final running = viewModel.detectingCrop; final canRun = viewModel.selectedItem != null && !running; - final scheme = theme.colorScheme; final children = [ Row( children: [ - Badge( - isLabelVisible: WhatsNewService.instance.isNew(sinceAppVersion), - backgroundColor: scheme.tertiaryContainer, - textColor: scheme.onTertiaryContainer, - textStyle: const TextStyle(fontSize: 9, fontWeight: FontWeight.w700, letterSpacing: 0.4), - offset: const Offset(10, -8), - label: const Text('NEW'), + NewCornerBadge( + visible: WhatsNewService.instance.isNew(sinceAppVersion), child: OutlinedButton.icon( onPressed: canRun ? viewModel.detectCrop : null, icon: running diff --git a/app/lib/views/settings/addons_settings_tab.dart b/app/lib/views/settings/addons_settings_tab.dart index cba4836d..01cbf4de 100644 --- a/app/lib/views/settings/addons_settings_tab.dart +++ b/app/lib/views/settings/addons_settings_tab.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../services/addon_service.dart'; import '../../services/whats_new_service.dart'; +import '../../widgets/new_badge.dart'; import '../addon_dialogs.dart'; /// Settings → Add-ons: every optional download, grouped by the feature that @@ -174,14 +175,8 @@ class AddonsTabLabel extends StatelessWidget { @override Widget build(BuildContext context) { - final scheme = Theme.of(context).colorScheme; - return Badge( - isLabelVisible: WhatsNewService.instance.isNew(AddonsSettingsTab.sinceAppVersion), - backgroundColor: scheme.tertiaryContainer, - textColor: scheme.onTertiaryContainer, - textStyle: const TextStyle(fontSize: 9, fontWeight: FontWeight.w700, letterSpacing: 0.4), - offset: const Offset(10, -8), - label: const Text('NEW'), + return NewCornerBadge( + visible: WhatsNewService.instance.isNew(AddonsSettingsTab.sinceAppVersion), child: const Text('Add-ons'), ); } diff --git a/app/lib/views/settings/settings_dialog.dart b/app/lib/views/settings/settings_dialog.dart index 9aee5bc8..d9ccd4c8 100644 --- a/app/lib/views/settings/settings_dialog.dart +++ b/app/lib/views/settings/settings_dialog.dart @@ -323,6 +323,18 @@ List audioCodecChoices(EncodingSettings settings) => class SettingsDialog extends StatefulWidget { const SettingsDialog({super.key}); + /// Whether Settings → Output holds something new since the last update: a + /// codec stamped with [VideoCodec.sinceAppVersion]. Badges the Video Codec + /// heading and the Output tab. Anything else new in the Output tab must be + /// added here, so the tab and the Settings button lead to it. + static bool get isOutputTabNew => + VideoCodec.values.any((c) => WhatsNewService.instance.isNew(c.sinceAppVersion)); + + /// Whether any Settings tab carries a NEW badge: the toolbar's Settings + /// button marks itself while this is true. + static bool get hasNew => + isOutputTabNew || WhatsNewService.instance.isNew(AddonsSettingsTab.sinceAppVersion); + @override State createState() => _SettingsDialogState(); } @@ -384,7 +396,7 @@ class _SettingsDialogState extends State controller: _tabController, tabs: [ const Tab(text: 'General'), - const Tab(text: 'Output'), + const Tab(child: OutputTabLabel()), const Tab(text: 'Input'), const Tab(child: AddonsTabLabel()), const Tab(text: 'Changes'), @@ -723,6 +735,18 @@ class _ChangesSettingsTabState extends State<_ChangesSettingsTab> { } } +/// The Output tab's label, with its NEW badge overlaid on the corner (as +/// [AddonsTabLabel]: the tabs share the dialog's width equally). +class OutputTabLabel extends StatelessWidget { + const OutputTabLabel({super.key}); + + @override + Widget build(BuildContext context) => NewCornerBadge( + visible: SettingsDialog.isOutputTabNew, + child: const Text('Output'), + ); +} + class _OutputSettingsTab extends StatefulWidget { const _OutputSettingsTab(); @@ -1029,6 +1053,7 @@ class _OutputSettingsTabState extends State<_OutputSettingsTab> { _buildSection( context, title: 'Video Codec', + isNew: SettingsDialog.isOutputTabNew, child: _buildCodecList(context, viewModel, settings), ), @@ -1967,6 +1992,12 @@ class _OutputSettingsTabState extends State<_OutputSettingsTab> { style: clickable ? null : disabledStyle, ), ), + // Badged whether or not it can be chosen here: a disabled AV1 in + // MOV is still where the user learns it exists, beside the reason. + if (WhatsNewService.instance.isNew(codec.sinceAppVersion)) ...[ + const SizedBox(width: 6), + const NewBadge(), + ], if (indicator != null) ...[ const SizedBox(width: 8), indicator, @@ -2064,16 +2095,25 @@ class _OutputSettingsTabState extends State<_OutputSettingsTab> { BuildContext context, { required String title, required Widget child, + bool isNew = false, }) { + final heading = Text( + title, + style: Theme.of(context).textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.bold, + ), + ); return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - title, - style: Theme.of(context).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.bold, - ), - ), + if (isNew) + Row(children: [ + Flexible(child: heading), + const SizedBox(width: 6), + const NewBadge(), + ]) + else + heading, const SizedBox(height: 12), child, ], diff --git a/app/lib/widgets/before_after_comparison.dart b/app/lib/widgets/before_after_comparison.dart index 48004d1f..4a41a872 100644 --- a/app/lib/widgets/before_after_comparison.dart +++ b/app/lib/widgets/before_after_comparison.dart @@ -7,8 +7,10 @@ import 'package:flutter/services.dart'; import '../models/app_shortcut.dart'; import '../services/image_dimensions.dart'; +import '../services/whats_new_service.dart'; import 'comparison_view_mode.dart'; import 'comparison_zoom_controller.dart'; +import 'new_badge.dart'; /// A widget that displays a before/after comparison with a draggable divider. /// @@ -737,6 +739,13 @@ class _BeforeAfterComparisonWidgetState /// Original | Split | Processed, styled like the zoom pill, in the order /// the panes sit. Widget _buildViewModeControl() { + return NewCornerBadge( + visible: WhatsNewService.instance.isNew(ComparisonViewMode.sinceAppVersion), + child: _buildViewModePill(), + ); + } + + Widget _buildViewModePill() { return Container( key: const Key('comparison-view-mode'), decoration: BoxDecoration( diff --git a/app/lib/widgets/comparison_view_mode.dart b/app/lib/widgets/comparison_view_mode.dart index 8e10d559..97e82d7d 100644 --- a/app/lib/widgets/comparison_view_mode.dart +++ b/app/lib/widgets/comparison_view_mode.dart @@ -12,6 +12,10 @@ enum ComparisonViewMode { final String description; const ComparisonViewMode(this.label, this.description); + /// The app version the Original / Split / Processed control shipped in, + /// for its NEW badge. Never change it once shipped. + static const sinceAppVersion = '1.8.0'; + /// The keyboard shortcut that selects this mode. AppShortcut get shortcut => switch (this) { ComparisonViewMode.original => AppShortcut.previewOriginal, diff --git a/app/lib/widgets/new_badge.dart b/app/lib/widgets/new_badge.dart index 9a3817ab..5cb8e3e3 100644 --- a/app/lib/widgets/new_badge.dart +++ b/app/lib/widgets/new_badge.dart @@ -30,3 +30,27 @@ class NewBadge extends StatelessWidget { ); } } + +/// A "NEW" label overlaid on [child]'s top-right corner, for a control with no +/// room for a [NewBadge] pill beside it (a tab label, a button, the preview's +/// view-mode pill). Draws [child] alone when [visible] is false. +class NewCornerBadge extends StatelessWidget { + final bool visible; + final Widget child; + + const NewCornerBadge({super.key, required this.visible, required this.child}); + + @override + Widget build(BuildContext context) { + final scheme = Theme.of(context).colorScheme; + return Badge( + isLabelVisible: visible, + backgroundColor: scheme.tertiaryContainer, + textColor: scheme.onTertiaryContainer, + textStyle: const TextStyle(fontSize: 9, fontWeight: FontWeight.w700, letterSpacing: 0.4), + offset: const Offset(10, -8), + label: const Text('NEW'), + child: child, + ); + } +} diff --git a/app/test/new_badges_outside_schemas_test.dart b/app/test/new_badges_outside_schemas_test.dart new file mode 100644 index 00000000..a9a7fe0b --- /dev/null +++ b/app/test/new_badges_outside_schemas_test.dart @@ -0,0 +1,264 @@ +// The NEW badges on things that are not schema elements (task #133): the +// codecs offered in Settings → Output (VideoCodec.sinceAppVersion), and the +// preview's Original / Split / Processed control +// (ComparisonViewMode.sinceAppVersion). Each badge leads to what is new: a +// codec badges its radio, the Video Codec heading, the Output tab and the +// toolbar's Settings button (SettingsDialog.hasNew). +import 'dart:io'; +import 'dart:typed_data'; +import 'dart:ui' as ui; + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; +import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:vapourbox/models/video_job.dart'; +import 'package:vapourbox/services/advanced_mode_service.dart'; +import 'package:vapourbox/services/theme_service.dart'; +import 'package:vapourbox/services/whats_new_service.dart'; +import 'package:vapourbox/viewmodels/main_viewmodel.dart'; +import 'package:vapourbox/views/settings/addons_settings_tab.dart'; +import 'package:vapourbox/views/settings/settings_dialog.dart'; +import 'package:vapourbox/widgets/before_after_comparison.dart'; +import 'package:vapourbox/widgets/comparison_view_mode.dart'; +import 'package:vapourbox/widgets/new_badge.dart'; + +/// Launch [current] after last running [lastRun] (null: a fresh install). +Future _launch(String current, {String? lastRun}) async { + SharedPreferences.setMockInitialValues({ + if (lastRun != null) 'lastRunAppVersion': lastRun, + if (lastRun != null) 'lastSeenAppVersion': lastRun, + }); + PackageInfo.setMockInitialValues( + appName: 'VapourBox', packageName: 'app.vapourbox.vapourbox', + version: current, buildNumber: '1', buildSignature: ''); + WhatsNewService.instance.resetForTesting(); + await WhatsNewService.instance.initialize(); +} + +int _compare(String a, String b) { + final pa = a.split('.').map(int.parse).toList(); + final pb = b.split('.').map(int.parse).toList(); + for (var i = 0; i < 3; i++) { + if (pa[i] != pb[i]) return pa[i].compareTo(pb[i]); + } + return 0; +} + +Future _png(int width, int height) async { + final recorder = ui.PictureRecorder(); + Canvas(recorder).drawRect(Rect.fromLTWH(0, 0, width.toDouble(), height.toDouble()), + Paint()..color = const Color(0xFF808080)); + final image = await recorder.endRecording().toImage(width, height); + final data = await image.toByteData(format: ui.ImageByteFormat.png); + image.dispose(); + return data!.buffer.asUint8List(); +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + final service = WhatsNewService.instance; + tearDown(service.resetForTesting); + + group('stamps', () { + test('AV1 and v210 are the codecs stamped 1.8.0, and no other codec is stamped', () { + final stamped = { + for (final c in VideoCodec.values) + if (c.sinceAppVersion != null) c: c.sinceAppVersion, + }; + // Pinned: a shipped stamp must never change. + expect(stamped, {VideoCodec.av1: '1.8.0', VideoCodec.v210: '1.8.0'}); + expect(ComparisonViewMode.sinceAppVersion, '1.8.0'); + }); + + test('no stamp is ahead of the app version', () { + final version = RegExp(r'^version:\s*(\d+\.\d+\.\d+)', multiLine: true) + .firstMatch(File('pubspec.yaml').readAsStringSync())! + .group(1)!; + for (final since in [ + ...VideoCodec.values.map((c) => c.sinceAppVersion).whereType(), + ComparisonViewMode.sinceAppVersion, + ]) { + expect(_compare(since, version), lessThanOrEqualTo(0), reason: since); + } + }); + }); + + group('which badges show', () { + test('upgrading from 1.7.0 to 1.8.0 badges AV1, v210, the Output tab and Settings', () async { + await _launch('1.8.0', lastRun: '1.7.0'); + expect(VideoCodec.values.where((c) => service.isNew(c.sinceAppVersion)).toSet(), + {VideoCodec.av1, VideoCodec.v210}); + expect(service.isNew(ComparisonViewMode.sinceAppVersion), isTrue); + expect(SettingsDialog.isOutputTabNew, isTrue); + expect(SettingsDialog.hasNew, isTrue); + }); + + test('a fresh install badges nothing', () async { + await _launch('1.8.0'); + expect(VideoCodec.values.where((c) => service.isNew(c.sinceAppVersion)), isEmpty); + expect(service.isNew(ComparisonViewMode.sinceAppVersion), isFalse); + expect(SettingsDialog.isOutputTabNew, isFalse); + expect(SettingsDialog.hasNew, isFalse); + }); + + test('the next feature release clears them', () async { + await _launch('1.9.0', lastRun: '1.8.0'); + expect(SettingsDialog.isOutputTabNew, isFalse); + expect(service.isNew(ComparisonViewMode.sinceAppVersion), isFalse); + expect(SettingsDialog.hasNew, + service.isNew(AddonsSettingsTab.sinceAppVersion)); + expect(SettingsDialog.hasNew, isFalse); + }); + }); + + // The tabs share the dialog's width equally; the badge is overlaid so it + // takes none. Flutter reports a RenderFlex overflow as a test failure. + testWidgets('the Output tab label fits its tab with the NEW badge on', (tester) async { + await _launch('1.8.0', lastRun: '1.7.0'); + for (final width in [600.0, 480.0]) { + await tester.binding.setSurfaceSize(Size(width, 200)); + await tester.pumpWidget(const MaterialApp( + home: DefaultTabController( + length: 5, + child: Scaffold( + appBar: _TabsBar(), + ), + ), + )); + await tester.pumpAndSettle(); + expect(tester.takeException(), isNull, reason: 'overflow at $width px'); + expect(find.text('NEW'), findsOneWidget); + expect(find.byType(NewBadge), findsNothing, reason: 'overlaid, not set beside'); + } + await tester.binding.setSurfaceSize(null); + }); + + group('the Output tab', () { + Future pumpOutputTab(WidgetTester tester, MainViewModel vm) async { + await tester.binding.setSurfaceSize(const Size(900, 4000)); + addTearDown(() => tester.binding.setSurfaceSize(null)); + await tester.pumpWidget(MultiProvider( + providers: [ + ChangeNotifierProvider.value(value: vm), + ChangeNotifierProvider.value(value: ThemeService.instance), + ChangeNotifierProvider.value( + value: AdvancedModeService.instance), + ], + child: const MaterialApp(home: Scaffold(body: SettingsDialog())), + )); + await tester.pump(); + await tester.tap(find.text('Output')); + await tester.pumpAndSettle(); + } + + // The dialog is at most 700 px tall and the tab a lazy ListView: scroll + // each row into view before looking at it. + Future reveal(WidgetTester tester, Finder finder) => tester.scrollUntilVisible( + finder, 200, + scrollable: find + .descendant(of: find.byType(ListView), matching: find.byType(Scrollable)) + .first); + + Finder radioRow(String name) => find.ancestor( + of: find.text(name), matching: find.byType(RadioListTile)); + + testWidgets('badges AV1, v210 and the Video Codec heading on the upgrade', (tester) async { + await _launch('1.8.0', lastRun: '1.7.0'); + final vm = MainViewModel(); + vm.updateEncodingSettings( + vm.encodingSettings.copyWith(container: ContainerFormat.mov)); + await pumpOutputTab(tester, vm); + + await reveal(tester, find.text('Video Codec')); + final heading = find.ancestor(of: find.text('Video Codec'), matching: find.byType(Row)); + expect(find.descendant(of: heading, matching: find.byType(NewBadge)), findsOneWidget); + for (final codec in [VideoCodec.av1, VideoCodec.v210]) { + await reveal(tester, find.text(codec.displayName)); + expect( + find.descendant(of: radioRow(codec.displayName), matching: find.byType(NewBadge)), + findsOneWidget, + reason: '${codec.displayName}, listed in MOV (AV1 disabled with its reason)'); + } + await reveal(tester, find.text(VideoCodec.h264.displayName)); + expect( + find.descendant( + of: radioRow(VideoCodec.h264.displayName), matching: find.byType(NewBadge)), + findsNothing); + }); + + testWidgets('badges nothing on a fresh install', (tester) async { + await _launch('1.8.0'); + await pumpOutputTab(tester, MainViewModel()); + await reveal(tester, find.text(VideoCodec.av1.displayName)); + expect(find.text('Video Codec'), findsOneWidget); + expect(find.byType(NewBadge), findsNothing); + expect(find.text('NEW'), findsNothing); + }); + }); + + group('the preview view-mode control', () { + Future pump(WidgetTester tester, {ValueChanged? onChanged}) async { + final image = (await tester.runAsync(() => _png(64, 48)))!; + await tester.pumpWidget(MaterialApp( + home: Align( + alignment: Alignment.topLeft, + child: SizedBox( + width: 400, + height: 300, + child: BeforeAfterComparisonWidget( + beforeImage: image, + afterImage: image, + beforeAspectRatio: 4 / 3, + afterAspectRatio: 4 / 3, + onViewModeChanged: onChanged, + ), + ), + ), + )); + await tester.pumpAndSettle(); + } + + testWidgets('is badged on the upgrade, inside the preview', (tester) async { + await _launch('1.8.0', lastRun: '1.7.0'); + await pump(tester, onChanged: (_) {}); + final badge = find.text('NEW'); + expect(badge, findsOneWidget); + final rect = tester.getRect(badge); + expect(const Rect.fromLTWH(0, 0, 400, 300).contains(rect.topLeft), isTrue, + reason: 'drawn within the preview: $rect'); + expect(find.byKey(const Key('comparison-view-mode')), findsOneWidget); + }); + + testWidgets('is not badged on a fresh install', (tester) async { + await _launch('1.8.0'); + await pump(tester, onChanged: (_) {}); + expect(find.text('NEW'), findsNothing); + }); + + testWidgets('has no badge when the control is not shown', (tester) async { + await _launch('1.8.0', lastRun: '1.7.0'); + await pump(tester); + expect(find.text('NEW'), findsNothing); + }); + }); +} + +class _TabsBar extends StatelessWidget implements PreferredSizeWidget { + const _TabsBar(); + + @override + Size get preferredSize => const Size.fromHeight(kToolbarHeight + kTextTabBarHeight); + + @override + Widget build(BuildContext context) => AppBar( + bottom: const TabBar(tabs: [ + Tab(text: 'General'), + Tab(child: OutputTabLabel()), + Tab(text: 'Input'), + Tab(text: 'Add-ons'), + Tab(text: 'Changes'), + ]), + ); +} diff --git a/docs/FILTER_SCHEMA.md b/docs/FILTER_SCHEMA.md index 3752ae31..1bcd87e5 100644 --- a/docs/FILTER_SCHEMA.md +++ b/docs/FILTER_SCHEMA.md @@ -258,6 +258,23 @@ badges nothing (`filter_schema_curation_test.dart` refuses one). `new_badges_shipped_test.dart` pins the current release's badges on the real schemas; extend it when stamping a release's additions. +**Outside the schemas**, a thing that is not a schema element carries a +hard-coded stamp, read through the same `WhatsNewService.isNew`: + +| What is new | Stamp | Badged | +|---|---|---| +| a Settings tab | `static const sinceAppVersion` on the tab (`AddonsSettingsTab`) | its tab label | +| a panel control | `static const sinceAppVersion` on the widget (`CropDetectPanel`) | the control | +| a codec | `VideoCodec.sinceAppVersion` (`app/lib/models/video_job.dart`) | its radio in Settings → Output | +| the preview's Original / Split / Processed control | `ComparisonViewMode.sinceAppVersion` | the control | + +The same leading rule applies: a new codec badges its radio, the Video Codec +heading and the Output tab (`SettingsDialog.isOutputTabNew`), and any new tab +content badges the toolbar's Settings button (`SettingsDialog.hasNew`). Add a +new kind of Settings item to those two getters, or nothing leads to it. The +rules below hold for these stamps too. `new_badges_outside_schemas_test.dart` +pins them and checks the badges. + ```json { "sinceAppVersion": "1.2.0",