From 31dbed7a1f525e22611be5790096d9f41ff0c1d8 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 17 Aug 2025 10:34:26 -0500 Subject: [PATCH] cleanup --- .../include/rpc/client/client.hpp | 2 +- web/repertory/lib/constants.dart | 12 ++++++---- web/repertory/lib/main.dart | 12 ++++------ .../lib/screens/add_mount_screen.dart | 22 +------------------ .../lib/screens/edit_mount_screen.dart | 22 +------------------ .../lib/screens/edit_settings_screen.dart | 16 +------------- web/repertory/lib/screens/home_screen.dart | 6 ++--- web/repertory/lib/settings.dart | 2 ++ web/repertory/lib/widgets/mount_widget.dart | 2 +- 9 files changed, 21 insertions(+), 75 deletions(-) diff --git a/repertory/librepertory/include/rpc/client/client.hpp b/repertory/librepertory/include/rpc/client/client.hpp index 0e9f64de..e07df4cf 100644 --- a/repertory/librepertory/include/rpc/client/client.hpp +++ b/repertory/librepertory/include/rpc/client/client.hpp @@ -30,7 +30,7 @@ public: explicit client(rpc_host_info host_info); private: - const rpc_host_info host_info_; + rpc_host_info host_info_; std::atomic request_id_{0U}; public: diff --git a/web/repertory/lib/constants.dart b/web/repertory/lib/constants.dart index d4196392..860b28a4 100644 --- a/web/repertory/lib/constants.dart +++ b/web/repertory/lib/constants.dart @@ -3,22 +3,26 @@ import 'package:flutter/material.dart' show GlobalKey, NavigatorState, Color; import 'package:sodium_libs/sodium_libs.dart'; +const accentBlue = Color(0xFF1050A0); const addMountTitle = 'Add New Mount'; const appLogonTitle = 'Repertory Portal Login'; const appSettingsTitle = 'Portal Settings'; const appTitle = 'Repertory Management Portal'; -const logonWidth = 300.0; +const borderRadius = 16.0; +const borderRadiusSmall = 8.0; const databaseTypeList = ['rocksdb', 'sqlite']; const downloadTypeList = ['default', 'direct', 'ring_buffer']; const eventLevelList = ['critical', 'error', 'warn', 'info', 'debug', 'trace']; +const gradientColors = [Color(0xFF0A0F1F), Color(0xFF1B1C1F)]; +const gradientColors2 = [Color(0x07FFFFFF), Color(0x00000000)]; +const logonWidth = 300.0; const padding = 16.0; const paddingSmall = 8.0; -const borderRadius = 16.0; -const borderRadiusSmall = 8.0; const protocolTypeList = ['http', 'https']; const providerTypeList = ['Encrypt', 'Remote', 'S3', 'Sia']; const ringBufferSizeList = ['128', '256', '512', '1024', '2048']; -const gradientColors = [Color(0xFF0A0F1F), Color(0xFF1B1C1F)]; +const surfaceContainerLowDark = Color(0xFF292A2D); +const surfaceDark = Color(0xFF202124); final GlobalKey navigatorKey = GlobalKey(); diff --git a/web/repertory/lib/main.dart b/web/repertory/lib/main.dart index 8cd7e6cf..d0d98e6c 100644 --- a/web/repertory/lib/main.dart +++ b/web/repertory/lib/main.dart @@ -43,10 +43,6 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - static const Color accentBlue = Color(0xFF1050A0); - static const Color surfaceDark = Color(0xFF202124); - static const Color surfaceContainerLowDark = Color(0xFF292A2D); - @override Widget build(context) { final snackBarTheme = SnackBarThemeData( @@ -62,12 +58,12 @@ class _MyAppState extends State { brightness: Brightness.dark, colorScheme: ColorScheme.fromSeed( brightness: Brightness.dark, - seedColor: accentBlue, + seedColor: constants.accentBlue, onSurface: Colors.white70, - surface: surfaceDark, - surfaceContainerLow: surfaceContainerLowDark, + surface: constants.surfaceDark, + surfaceContainerLow: constants.surfaceContainerLowDark, ), - scaffoldBackgroundColor: surfaceDark, + scaffoldBackgroundColor: constants.surfaceDark, snackBarTheme: snackBarTheme, appBarTheme: const AppBarTheme(scrolledUnderElevation: 0), inputDecorationTheme: const InputDecorationTheme( diff --git a/web/repertory/lib/screens/add_mount_screen.dart b/web/repertory/lib/screens/add_mount_screen.dart index 0e43e5ae..0f626e11 100644 --- a/web/repertory/lib/screens/add_mount_screen.dart +++ b/web/repertory/lib/screens/add_mount_screen.dart @@ -57,7 +57,7 @@ class _AddMountScreenState extends State { gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Color(0x07FFFFFF), Color(0x00000000)], + colors: constants.gradientColors2, ), boxShadow: [ BoxShadow( @@ -81,7 +81,6 @@ class _AddMountScreenState extends State { body: SafeArea( child: Stack( children: [ - // Background Container( width: double.infinity, height: double.infinity, @@ -105,17 +104,13 @@ class _AddMountScreenState extends State { child: Container(color: Colors.black.withValues(alpha: 0.06)), ), ), - - // Content Padding( padding: const EdgeInsets.all(constants.padding), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - // Header: Back • Title • Logout Row( children: [ - // Back tile Material( color: Colors.transparent, child: InkWell( @@ -165,10 +160,7 @@ class _AddMountScreenState extends State { ), ), ), - const SizedBox(width: constants.padding), - - // Logout capsule (glassy) ClipRRect( borderRadius: BorderRadius.circular( constants.borderRadius, @@ -209,10 +201,7 @@ class _AddMountScreenState extends State { ), ], ), - const SizedBox(height: constants.padding), - - // Provider Type (glassy tile) glassTile( child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -246,10 +235,8 @@ class _AddMountScreenState extends State { ], ), ), - if (_mountType.isNotEmpty && _mountType != 'Remote') ...[ const SizedBox(height: constants.padding), - // Config Name (glassy tile) glassTile( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -292,10 +279,8 @@ class _AddMountScreenState extends State { ), ), ], - if (_mount != null) ...[ const SizedBox(height: constants.padding), - // Settings (large glass container) Expanded( child: glassTile( padding: EdgeInsets.zero, @@ -311,11 +296,8 @@ class _AddMountScreenState extends State { ), ), const SizedBox(height: constants.padding), - - // Action buttons row Row( children: [ - // Test ElevatedButton.icon( label: const Text('Test'), icon: const Icon(Icons.check), @@ -340,8 +322,6 @@ class _AddMountScreenState extends State { onPressed: _handleProviderTest, ), const SizedBox(width: constants.padding), - - // Add ElevatedButton.icon( label: const Text('Add'), icon: const Icon(Icons.add), diff --git a/web/repertory/lib/screens/edit_mount_screen.dart b/web/repertory/lib/screens/edit_mount_screen.dart index c38a55f1..d405a96f 100644 --- a/web/repertory/lib/screens/edit_mount_screen.dart +++ b/web/repertory/lib/screens/edit_mount_screen.dart @@ -32,7 +32,6 @@ class _EditMountScreenState extends State { body: SafeArea( child: Stack( children: [ - // Background gradient Container( width: double.infinity, height: double.infinity, @@ -44,35 +43,28 @@ class _EditMountScreenState extends State { ), ), ), - // Subtle aurora sweep const AuroraSweep( enabled: true, duration: Duration(seconds: 28), primaryAlphaA: 0.04, primaryAlphaB: 0.03, ), - // Light blur + tint for glassiness Positioned.fill( child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 6, sigmaY: 6), child: Container(color: Colors.black.withValues(alpha: 0.06)), ), ), - - // Foreground content Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: constants.padding), - - // Header row: Back • Title • Advanced • Logout Padding( padding: const EdgeInsets.symmetric( horizontal: constants.padding, ), child: Row( children: [ - // Back tile (glassy) Material( color: Colors.transparent, child: InkWell( @@ -108,10 +100,7 @@ class _EditMountScreenState extends State { ), ), ), - const SizedBox(width: constants.padding), - - // Title Expanded( child: Text( widget.title, @@ -124,10 +113,7 @@ class _EditMountScreenState extends State { ), ), ), - const SizedBox(width: constants.padding), - - // Advanced toggle capsule (glassy) ClipRRect( borderRadius: BorderRadius.circular( constants.borderRadius, @@ -189,10 +175,7 @@ class _EditMountScreenState extends State { ), ), ), - const SizedBox(width: constants.padding), - - // Logout capsule (glassy) ClipRRect( borderRadius: BorderRadius.circular( constants.borderRadius, @@ -234,10 +217,7 @@ class _EditMountScreenState extends State { ], ), ), - const SizedBox(height: constants.padding), - - // Glass container hosting the settings list Expanded( child: Padding( padding: const EdgeInsets.symmetric( @@ -260,7 +240,7 @@ class _EditMountScreenState extends State { gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Color(0x07FFFFFF), Color(0x00000000)], + colors: constants.gradientColors2, ), boxShadow: [ BoxShadow( diff --git a/web/repertory/lib/screens/edit_settings_screen.dart b/web/repertory/lib/screens/edit_settings_screen.dart index 55b69aaf..5122abf2 100644 --- a/web/repertory/lib/screens/edit_settings_screen.dart +++ b/web/repertory/lib/screens/edit_settings_screen.dart @@ -30,7 +30,6 @@ class _EditSettingsScreenState extends State { body: SafeArea( child: Stack( children: [ - // Background Container( width: double.infinity, height: double.infinity, @@ -54,21 +53,16 @@ class _EditSettingsScreenState extends State { child: Container(color: Colors.black.withValues(alpha: 0.06)), ), ), - - // Content Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: constants.padding), - - // Header row: Back + Title + Logout capsule Padding( padding: const EdgeInsets.symmetric( horizontal: constants.padding, ), child: Row( children: [ - // Back button styled like our glass tiles Material( color: Colors.transparent, child: InkWell( @@ -105,8 +99,6 @@ class _EditSettingsScreenState extends State { ), ), const SizedBox(width: constants.padding), - - // Title Expanded( child: Text( widget.title, @@ -119,10 +111,7 @@ class _EditSettingsScreenState extends State { ), ), ), - const SizedBox(width: constants.padding), - - // Logout capsule (glassy) ClipRRect( borderRadius: BorderRadius.circular( constants.borderRadius, @@ -164,10 +153,7 @@ class _EditSettingsScreenState extends State { ], ), ), - const SizedBox(height: constants.padding), - - // Glass container holding the settings list Expanded( child: Padding( padding: const EdgeInsets.symmetric( @@ -190,7 +176,7 @@ class _EditSettingsScreenState extends State { gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Color(0x07FFFFFF), Color(0x00000000)], + colors: constants.gradientColors2, ), boxShadow: [ BoxShadow( diff --git a/web/repertory/lib/screens/home_screen.dart b/web/repertory/lib/screens/home_screen.dart index 21b2aa49..ddfc4fba 100644 --- a/web/repertory/lib/screens/home_screen.dart +++ b/web/repertory/lib/screens/home_screen.dart @@ -160,24 +160,22 @@ class _HomeScreeState extends State { tag: 'add_mount_fab', child: Material( color: Colors.transparent, - elevation: 12, // match card depth + elevation: 12, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(constants.borderRadius), ), child: Ink( decoration: BoxDecoration( - // glassy base like MountWidget Card (but a touch bluer) color: scheme.primary.withValues(alpha: 0.10), borderRadius: BorderRadius.circular(constants.borderRadius), border: Border.all( color: scheme.outlineVariant.withValues(alpha: 0.15), width: 1, ), - // subtle top highlight for crisp glass gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Color(0x07FFFFFF), Color(0x00000000)], + colors: constants.gradientColors2, ), boxShadow: [ BoxShadow( diff --git a/web/repertory/lib/settings.dart b/web/repertory/lib/settings.dart index 0c451fbf..68d9a8ba 100644 --- a/web/repertory/lib/settings.dart +++ b/web/repertory/lib/settings.dart @@ -1,3 +1,5 @@ +// settings.dart + import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/web/repertory/lib/widgets/mount_widget.dart b/web/repertory/lib/widgets/mount_widget.dart index e211596a..0ecc5bf7 100644 --- a/web/repertory/lib/widgets/mount_widget.dart +++ b/web/repertory/lib/widgets/mount_widget.dart @@ -41,7 +41,7 @@ class _MountWidgetState extends State { gradient: const LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Color(0x07FFFFFF), Color(0x00000000)], + colors: constants.gradientColors2, ), boxShadow: [ BoxShadow(