From d00cbe36cfc386ff727481be9aae873c2172ce36 Mon Sep 17 00:00:00 2001 From: cogwheel0 <172976095+cogwheel0@users.noreply.github.com> Date: Tue, 21 Oct 2025 00:09:12 +0530 Subject: [PATCH] refactor: Replace hardcoded monospace font with AppTypography constant - Updated multiple instances of the 'monospace' font family to use AppTypography.monospaceFontFamily for consistency across the application. - This change enhances maintainability and ensures a unified typography approach throughout the app. --- lib/core/services/user_friendly_error_handler.dart | 4 ++-- lib/features/auth/views/authentication_page.dart | 2 +- lib/features/auth/views/connection_issue_page.dart | 2 +- lib/features/auth/views/server_connection_page.dart | 2 +- lib/features/chat/widgets/assistant_message_widget.dart | 8 ++++---- lib/shared/theme/theme_extensions.dart | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/core/services/user_friendly_error_handler.dart b/lib/core/services/user_friendly_error_handler.dart index fb5fa2e..70fb7f8 100644 --- a/lib/core/services/user_friendly_error_handler.dart +++ b/lib/core/services/user_friendly_error_handler.dart @@ -456,7 +456,7 @@ class ErrorCard extends StatelessWidget { child: SelectableText( technicalDetails!, style: const TextStyle( - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, fontSize: AppTypography.labelMedium, ), ), @@ -539,7 +539,7 @@ class ErrorDialog extends StatelessWidget { SelectableText( technicalDetails!, style: const TextStyle( - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, fontSize: AppTypography.labelMedium, ), ), diff --git a/lib/features/auth/views/authentication_page.dart b/lib/features/auth/views/authentication_page.dart index d2d926c..5ece084 100644 --- a/lib/features/auth/views/authentication_page.dart +++ b/lib/features/auth/views/authentication_page.dart @@ -288,7 +288,7 @@ class _AuthenticationPageState extends ConsumerState { hostText, style: context.conduitTheme.bodySmall?.copyWith( color: context.conduitTheme.textSecondary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, ), ), ], diff --git a/lib/features/auth/views/connection_issue_page.dart b/lib/features/auth/views/connection_issue_page.dart index a2b164c..62ae029 100644 --- a/lib/features/auth/views/connection_issue_page.dart +++ b/lib/features/auth/views/connection_issue_page.dart @@ -151,7 +151,7 @@ class _ConnectionIssuePageState extends ConsumerState { textAlign: TextAlign.center, style: context.conduitTheme.bodyMedium?.copyWith( color: context.conduitTheme.textPrimary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, ), ), const SizedBox(height: Spacing.xs), diff --git a/lib/features/auth/views/server_connection_page.dart b/lib/features/auth/views/server_connection_page.dart index 7c929ae..5d13db5 100644 --- a/lib/features/auth/views/server_connection_page.dart +++ b/lib/features/auth/views/server_connection_page.dart @@ -721,7 +721,7 @@ class _ServerConnectionPageState extends ConsumerState { entry.value, style: context.conduitTheme.bodySmall?.copyWith( color: context.conduitTheme.textSecondary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, ), overflow: TextOverflow.ellipsis, ), diff --git a/lib/features/chat/widgets/assistant_message_widget.dart b/lib/features/chat/widgets/assistant_message_widget.dart index 022c332..370ee77 100644 --- a/lib/features/chat/widgets/assistant_message_widget.dart +++ b/lib/features/chat/widgets/assistant_message_widget.dart @@ -385,7 +385,7 @@ class _AssistantMessageWidgetState extends ConsumerState style: TextStyle( fontSize: AppTypography.bodySmall, color: theme.textSecondary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, height: 1.35, ), ), @@ -407,7 +407,7 @@ class _AssistantMessageWidgetState extends ConsumerState style: TextStyle( fontSize: AppTypography.bodySmall, color: theme.textSecondary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, height: 1.35, ), ), @@ -1207,7 +1207,7 @@ class _AssistantMessageWidgetState extends ConsumerState style: TextStyle( fontSize: AppTypography.bodySmall, color: theme.textSecondary, - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, height: 1.4, ), ), @@ -1994,7 +1994,7 @@ class CodeExecutionListView extends StatelessWidget { child: SelectableText( execution.code!, style: const TextStyle( - fontFamily: 'monospace', + fontFamily: AppTypography.monospaceFontFamily, height: 1.4, ), ), diff --git a/lib/shared/theme/theme_extensions.dart b/lib/shared/theme/theme_extensions.dart index 0c66c1d..8f4bd64 100644 --- a/lib/shared/theme/theme_extensions.dart +++ b/lib/shared/theme/theme_extensions.dart @@ -1168,7 +1168,7 @@ class ConduitShadows { class AppTypography { // Primary UI font now uses the platform default system font static const String fontFamily = ''; - static const String monospaceFontFamily = 'SF Mono'; + static const String monospaceFontFamily = 'monospace'; // Letter spacing values - Enhanced for better readability static const double letterSpacingTight = -0.5;