From ba82793a674149cda0e516dd802ccfdad027bc76 Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:39:09 -0500 Subject: [PATCH 1/8] ui: replace stacked Node Leaf and MLT Player banners with one online studio launcher --- lib/ui/home_screen.dart | 284 ++++++++++++++-------------------------- 1 file changed, 99 insertions(+), 185 deletions(-) diff --git a/lib/ui/home_screen.dart b/lib/ui/home_screen.dart index 9764ee2..ff19968 100644 --- a/lib/ui/home_screen.dart +++ b/lib/ui/home_screen.dart @@ -186,6 +186,45 @@ class _HomeScreenState extends State } } + Widget _buildStudioLaunchButton({ + required String label, + required IconData icon, + required bool compact, + required VoidCallback onPressed, + }) { + return DecoratedBox( + decoration: BoxDecoration( + gradient: const LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [Color(0xFFAB2A32), Color(0xFF831C26)], + ), + borderRadius: BorderRadius.circular(8), + ), + child: ElevatedButton.icon( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.transparent, + shadowColor: Colors.transparent, + foregroundColor: Colors.white, + elevation: 0, + padding: EdgeInsets.symmetric( + horizontal: compact ? 10 : 22, + vertical: 14, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + icon: Icon(icon, size: 19), + label: Text( + label, + style: const TextStyle(fontWeight: FontWeight.w600), + ), + onPressed: onPressed, + ), + ); + } + // --- UI: THE BIG ROUNDED RECTANGLE BUTTONS --- Widget _buildMenu() { final hubState = context.watch(); @@ -557,120 +596,10 @@ class _HomeScreenState extends State ), ), - // --- NODE LEAF STATUS / STUDIO LAUNCHER --- - AnimatedContainer( - duration: const Duration(milliseconds: 300), - height: hubState.isServerRunning ? 82 : 0, - width: double.infinity, - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Color(0xFF25252D), Color(0xFF1E1E24)], - ), - border: Border( - top: BorderSide(color: Color(0xFF383842)), - ), - ), - child: ClipRect( - child: SingleChildScrollView( - physics: const NeverScrollableScrollPhysics(), - child: LayoutBuilder( - builder: (context, constraints) { - final compact = constraints.maxWidth < 750; - return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 24, - vertical: 13, - ), - child: Row( - children: [ - Container( - width: 13, - height: 13, - decoration: const BoxDecoration( - color: Color(0xFF73D52C), - shape: BoxShape.circle, - ), - ), - const SizedBox(width: 12), - const Text( - 'Node Leaf', - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w600, - ), - ), - if (!compact) ...[ - const SizedBox(width: 22), - const SizedBox( - height: 28, - child: VerticalDivider( - color: Color(0xFF383842), - ), - ), - const SizedBox(width: 22), - const Text( - 'Server: ', - style: TextStyle(color: Color(0xFFE8E8EA)), - ), - const Text( - 'Online', - style: TextStyle( - color: Color(0xFF73D52C), - fontWeight: FontWeight.w600, - ), - ), - const Text( - ' (localhost:5000)', - style: TextStyle(color: Color(0xFF828290)), - ), - ], - const Spacer(), - DecoratedBox( - decoration: BoxDecoration( - gradient: const LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Color(0xFFAB2A32), Color(0xFF831C26)], - ), - borderRadius: BorderRadius.circular(8), - ), - child: ElevatedButton.icon( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.transparent, - shadowColor: Colors.transparent, - foregroundColor: Colors.white, - elevation: 0, - padding: EdgeInsets.symmetric( - horizontal: compact ? 12 : 24, - vertical: 14, - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - ), - icon: const Icon(Icons.play_arrow_rounded), - label: const Text( - 'Launch Node Leaf', - style: TextStyle(fontWeight: FontWeight.w600), - ), - onPressed: () => hubState.launchNodeLeaf(), - ), - ), - ], - ), - ); - }, - ), - ), - ), - ), - // MLT Player uses the same server-online slide-up pattern as - // Node Leaf. Hub only launches the app; MLT Player checks its own - // project registry and prompts for credentials when onboarding. + // One shared launcher. The Redleaf server supplies the online state + // for both Node Leaf and MLT Player, not two stacked banners. AnimatedContainer( + key: const ValueKey('redleaf-studio-launcher'), duration: const Duration(milliseconds: 300), height: hubState.isServerRunning ? 82 : 0, width: double.infinity, @@ -689,44 +618,43 @@ class _HomeScreenState extends State builder: (context, constraints) { final compact = constraints.maxWidth < 750; final configured = hubState.mltPlayerPath?.isNotEmpty ?? false; + final activeName = + hubState.activeProject?.name ?? 'Redleaf'; return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 24, + padding: EdgeInsets.symmetric( + horizontal: compact ? 12 : 24, vertical: 13, ), child: Row( children: [ - Container( - width: 13, - height: 13, - decoration: const BoxDecoration( - color: Color(0xFF73D52C), - shape: BoxShape.circle, - ), - ), - const SizedBox(width: 12), - const Text( - 'MLT Player', - style: TextStyle( - color: Colors.white, - fontSize: 16, - fontWeight: FontWeight.w600, - ), + const Icon( + Icons.circle, + color: Color(0xFF73D52C), + size: 13, ), + const SizedBox(width: 10), if (!compact) ...[ - const SizedBox(width: 22), - const SizedBox( - height: 28, - child: VerticalDivider( - color: Color(0xFF383842), + const Text( + 'REDLEAF', + style: TextStyle( + color: Colors.white, + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(width: 12), + const Text( + 'ONLINE · localhost:5000', + style: TextStyle( + color: Color(0xFF73D52C), + fontSize: 11, ), ), - const SizedBox(width: 22), - Expanded( + const SizedBox(width: 14), + Flexible( child: Text( - configured - ? 'Open ${hubState.activeProject?.name ?? 'Redleaf'} in MLT Player' - : 'Configure the MLT Player executable in Settings', + activeName, + maxLines: 1, overflow: TextOverflow.ellipsis, style: const TextStyle( color: Color(0xFF828290), @@ -735,53 +663,39 @@ class _HomeScreenState extends State ), ), ] else - const Spacer(), - if (!compact) const SizedBox(width: 12), - DecoratedBox( - decoration: BoxDecoration( - gradient: const LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Color(0xFFAB2A32), Color(0xFF831C26)], + const Text( + 'ONLINE', + style: TextStyle( + color: Color(0xFF73D52C), + fontSize: 11, + fontWeight: FontWeight.w600, ), - borderRadius: BorderRadius.circular(8), ), - child: ElevatedButton.icon( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.transparent, - shadowColor: Colors.transparent, - foregroundColor: Colors.white, - elevation: 0, - padding: EdgeInsets.symmetric( - horizontal: compact ? 12 : 24, - vertical: 14, - ), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - ), - ), - icon: Icon( - configured - ? Icons.play_arrow_rounded - : Icons.settings_outlined, - ), - label: Text( - configured - ? 'Launch MLT Player' - : 'Set MLT Player Path', - style: const TextStyle( - fontWeight: FontWeight.w600, - ), - ), - onPressed: configured - ? () => _launchMltPlayer(hubState) - : () => Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const SetupScreen(), - ), + const Spacer(), + _buildStudioLaunchButton( + label: compact ? 'Node Leaf' : 'Launch Node Leaf', + icon: Icons.play_arrow_rounded, + compact: compact, + onPressed: hubState.launchNodeLeaf, + ), + const SizedBox(width: 10), + _buildStudioLaunchButton( + label: configured + ? (compact ? 'MLT Player' : 'Launch MLT Player') + : (compact ? 'Set Path' : 'Set MLT Player Path'), + icon: configured + ? Icons.play_arrow_rounded + : Icons.settings_outlined, + compact: compact, + onPressed: configured + ? () => _launchMltPlayer(hubState) + : () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const SetupScreen(), ), - ), + ), ), ], ), From 98b268959c03b33c7aff8e5681d50945f4e2508a Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:39:22 -0500 Subject: [PATCH 2/8] test: Node Leaf and MLT Player share one Redleaf online launcher --- test/widget_test.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/widget_test.dart b/test/widget_test.dart index 2accb64..c7c85b9 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -233,6 +233,18 @@ void main() { expect(find.text('Launch Node Leaf'), findsOneWidget); expect(find.text('Launch MLT Player'), findsOneWidget); + expect( + find.byKey(const ValueKey('redleaf-studio-launcher')), + findsOneWidget, + ); + final launcher = tester.widget( + find.byKey(const ValueKey('redleaf-studio-launcher')), + ); + expect(launcher.constraints?.maxHeight, isNull); + expect(launcher.decoration, isNotNull); + expect(launcher.duration, const Duration(milliseconds: 300)); + expect(find.text('REDLEAF'), findsOneWidget); + expect(find.text('ONLINE · localhost:5000'), findsOneWidget); await tester.tap(find.text('Launch MLT Player')); await tester.pump(); From 8eaa64273b0f7e31d20fcfcd864f04c7e5a00b39 Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:39:32 -0500 Subject: [PATCH 3/8] test: assert unified studio launcher is 82 pixels high --- test/widget_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index c7c85b9..c842178 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -240,7 +240,7 @@ void main() { final launcher = tester.widget( find.byKey(const ValueKey('redleaf-studio-launcher')), ); - expect(launcher.constraints?.maxHeight, isNull); + expect(launcher.constraints?.maxHeight, 82.0); expect(launcher.decoration, isNotNull); expect(launcher.duration, const Duration(milliseconds: 300)); expect(find.text('REDLEAF'), findsOneWidget); From 1d06c96fb3756e67e0ff39df1c63c68b886ffc4f Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:45:36 -0500 Subject: [PATCH 4/8] ci: validate unified Hub launcher branch on push --- .github/workflows/flutter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index bdc327c..c76683a 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -3,7 +3,7 @@ name: Flutter on: push: - branches: [main, feature/mlt-player-project-launch] + branches: [main, feature/mlt-player-project-launch, feat-unified-launcher-bar] pull_request: jobs: From 4c3d95f8721e1d4aa1bb3cae92996c35cb0f3995 Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:48:56 -0500 Subject: [PATCH 5/8] test: compact unified Hub launcher shows both app actions without overflow --- test/widget_test.dart | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/widget_test.dart b/test/widget_test.dart index c842178..2222601 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -251,4 +251,37 @@ void main() { expect(online.launches, 1); }, timeout: const Timeout(Duration(seconds: 20))); + testWidgets('compact studio launcher retains both actions without overflow', + (tester) async { + tester.view.physicalSize = const Size(680, 800); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.resetPhysicalSize); + addTearDown(tester.view.resetDevicePixelRatio); + + final online = _OnlineMltHubState(); + await tester.runAsync( + () => _makeHubState(existing: online), + ); + addTearDown(online.dispose); + online + ..mltPlayerPath = '/virtual/mlt-player' + ..activeProject = online.projects.first; + + await tester.pumpWidget( + ChangeNotifierProvider.value( + value: online, + child: const RedleafHubApp(), + ), + ); + await tester.pump(); + await tester.tap(find.text('Open Project\\nLibrary')); + await tester.pump(const Duration(milliseconds: 350)); + + expect(find.text('Node Leaf'), findsOneWidget); + expect(find.text('MLT Player'), findsOneWidget); + expect(find.byKey(const ValueKey('redleaf-studio-launcher')), + findsOneWidget); + expect(tester.takeException(), isNull); + }, timeout: const Timeout(Duration(seconds: 20))); + } From 2a96f93f0ad3fdac0cd2b02871351c8c2fe8586d Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:49:14 -0500 Subject: [PATCH 6/8] test: use existing project library label with actual newline --- test/widget_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index 2222601..c30e584 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -274,7 +274,7 @@ void main() { ), ); await tester.pump(); - await tester.tap(find.text('Open Project\\nLibrary')); + await tester.tap(find.text('Open Project\nLibrary')); await tester.pump(const Duration(milliseconds: 350)); expect(find.text('Node Leaf'), findsOneWidget); From 0b2c391f83f8eaf2629ce6d3ff61cbaa9193cf0a Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:50:12 -0500 Subject: [PATCH 7/8] docs: consolidated Hub launcher and Redleaf linked-video thumbnail mode --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f1768e2..a19a8d7 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,12 @@ necessary. The cryptography implementation is compiled into the Flutter apps. ## 🎬 MLT Player launch and onboarding When Redleaf Hub shows the green **Online** status for an active project, the -Project Library reveals both **Launch Node Leaf** and **Launch MLT Player**. -If the MLT Player executable is not configured, the second bar provides a -shortcut to **Settings & Paths** instead. Hub opens the app as a detached -desktop process. +Project Library displays **one shared 82-pixel launcher bar** with the selected +Redleaf project, **Launch Node Leaf**, and **Launch MLT Player** side by side. +This replaces the two stacked online banners without changing either launch +action. If the MLT Player executable is not configured, its button opens +**Settings & Paths** instead. Hub launches each app as a detached desktop +process. On narrow windows the same actions use compact labels. The handoff arguments are: From dd7255b7f2007e2a7ab5c45d499bf9506ceb357c Mon Sep 17 00:00:00 2001 From: Nathaniel Westveer Date: Mon, 9 Nov 2026 04:52:28 -0500 Subject: [PATCH 8/8] test: initialize SharedPreferences before constructing online Hub state in widget tests --- test/widget_test.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/widget_test.dart b/test/widget_test.dart index c30e584..4f170cb 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -34,7 +34,9 @@ class _OnlineMltHubState extends _InMemoryHubState { Future<_InMemoryHubState> _makeHubState({ _InMemoryHubState? existing, }) async { - SharedPreferences.setMockInitialValues({}); + if (existing == null) { + SharedPreferences.setMockInitialValues({}); + } final state = existing ?? _InMemoryHubState(); if (state.isLoading) { @@ -210,6 +212,7 @@ void main() { addTearDown(tester.view.resetPhysicalSize); addTearDown(tester.view.resetDevicePixelRatio); + SharedPreferences.setMockInitialValues({}); final online = _OnlineMltHubState(); final loaded = await tester.runAsync( () => _makeHubState(existing: online), @@ -258,6 +261,7 @@ void main() { addTearDown(tester.view.resetPhysicalSize); addTearDown(tester.view.resetDevicePixelRatio); + SharedPreferences.setMockInitialValues({}); final online = _OnlineMltHubState(); await tester.runAsync( () => _makeHubState(existing: online),