From cab577ec8a718774de3b4e2d413134450647b1fa Mon Sep 17 00:00:00 2001 From: RyuJongJin <266630912+RyuJongJin@users.noreply.github.com> Date: Mon, 12 Oct 2026 08:00:27 +0900 Subject: [PATCH] =?UTF-8?q?WIP=20255=20=EC=84=B8=EB=A1=9C=20=ED=8F=B0=20?= =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EC=84=A4=EC=A0=95:=20=EB=AC=B6=EC=9D=8C?= =?UTF-8?q?=20=EB=B0=94=EB=A1=9C=EA=B0=80=EA=B8=B0=EB=A5=BC=20=ED=95=9C=20?= =?UTF-8?q?=EC=A4=84=EB=A1=9C=20(=EC=98=86=EC=9C=BC=EB=A1=9C=20=EB=B0=80?= =?UTF-8?q?=EA=B8=B0)=20(=EA=B2=80=ED=86=A0=20=EB=8C=80=EA=B8=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- lib/ui/settings_page.dart | 23 +++++++++++++++---- test/settings_group_bar_test.dart | 37 +++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 test/settings_group_bar_test.dart diff --git a/lib/ui/settings_page.dart b/lib/ui/settings_page.dart index 73c6751..83b8577 100644 --- a/lib/ui/settings_page.dart +++ b/lib/ui/settings_page.dart @@ -1157,9 +1157,8 @@ class _SettingsPageState extends State { }; /// 맨 위 바로가기: 묶음 이름을 누르면 그 묶음으로 스크롤 - Widget _groupBar(bool desk) => Padding( - padding: const EdgeInsets.only(bottom: 8), - child: Wrap(spacing: 8, runSpacing: 8, children: [ + Widget _groupBar(bool desk) { + final chips = [ for (final id in _groupIds) if ((id != 'run' || desk) && (id != 'ai' || c.settings.components.contains('aiimage')) && @@ -1175,8 +1174,24 @@ class _SettingsPageState extends State { } }, ), - ]), + ]; + // 255: 좁은 화면 (세로 폰) 은 한 줄로 옆으로 밀게 - 여러 줄로 감기면 위에 늘 고정된 4줄이 화면 절반을 차지해 내용이 반만 보였다 + if (isCompact(context)) { + return Padding( + padding: const EdgeInsets.only(bottom: 4), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row(children: [ + for (final (i, w) in chips.indexed) ...[if (i > 0) const SizedBox(width: 8), w], + ]), + ), ); + } + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Wrap(spacing: 8, runSpacing: 8, children: chips), + ); + } /// 묶음 하나: 제목 (아이콘) 과 항목들을 한 카드에 Widget _group(String id, IconData icon, String title, List children) => Card( diff --git a/test/settings_group_bar_test.dart b/test/settings_group_bar_test.dart new file mode 100644 index 0000000..36ccb4b --- /dev/null +++ b/test/settings_group_bar_test.dart @@ -0,0 +1,37 @@ +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:jj_mkvmaker/app/app_controller.dart'; +import 'package:jj_mkvmaker/platform/windows/desktop_storage_service.dart'; +import 'package:jj_mkvmaker/platform/windows/process_media_tool.dart'; +import 'package:jj_mkvmaker/services/platform_services.dart'; +import 'package:jj_mkvmaker/ui/settings_page.dart'; + +/// 255: 세로 폰의 환경 설정 - 위의 묶음 바로가기가 한 줄 (여러 줄로 감겨 화면 절반을 차지하지 않게) +void main() { + for (final (size, oneRow) in [(const Size(412, 900), true), (const Size(1400, 900), false)]) { + testWidgets('255: 묶음 바로가기 (${size.width.round()}×${size.height.round()}) - 좁으면 한 줄', (tester) async { + final tmp = Directory.systemTemp.createTempSync('jj_set255_'); + addTearDown(() => tmp.deleteSync(recursive: true)); + const pp = MethodChannel('plugins.flutter.io/path_provider'); + tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(pp, (_) async => tmp.path); + addTearDown(() => tester.binding.defaultBinaryMessenger.setMockMethodCallHandler(pp, null)); + tester.view.physicalSize = size; + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + final c = AppController(PlatformServices(mediaTool: ProcessMediaTool('x', 'y'), storage: DesktopStorageService())); + await tester.runAsync(() => tester.pumpWidget(MaterialApp(home: SettingsPage(c: c)))); + await tester.pump(); + final tops = {for (final e in find.byType(ActionChip).evaluate()) tester.getRect(find.byWidget(e.widget)).top.round()}; + expect(tops, isNotEmpty); + if (oneRow) { + expect(tops, hasLength(1), reason: '좁으면 한 줄 (옆으로 밀기)'); + } + expect(tester.takeException(), isNull); + await tester.pumpWidget(const SizedBox()); + await tester.pump(const Duration(seconds: 1)); + }); + } +}