Collapse duplicate map theme headers#52
Conversation
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
Co-authored-by: Dara Adedeji <SunkenInTime@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR refactors the settings panel into a more structured, scope-aware layout. It introduces a reusable Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
ST[SettingsTab] --> SSC1[SettingsScopeCard\n'Page object sizing'\nscope: strategy]
ST --> SSC2[SettingsScopeCard\n'Map visibility helpers'\nscope: workspace]
ST --> MTSS[MapThemeSettingsSection]
SSC1 --> SLT1[_SettingsSliderTile\nAgent markers]
SSC1 --> SLT2[_SettingsSliderTile\nAbility markers]
SSC2 --> STT1[_SettingsToggleTile\nSpawn barriers]
SSC2 --> STT2[_SettingsToggleTile\nRegion names]
SSC2 --> STT3[_SettingsToggleTile\nUltimate orbs]
MTSS --> SSC3[SettingsScopeCard\n'Map theme profiles'\nscope: strategy]
SSC3 --> TPS[_ThemeProfilesSection]
TPS --> ATC[_ActiveThemeCard]
TPS --> PLS[_ProfileLibrarySection]
Last reviewed commit: "Fix map theme header..." |
| Widget build(BuildContext context) { | ||
| return Column( | ||
| return const Column( | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: [ | ||
| SettingsScopeCard( | ||
| scope: SettingsScope.strategy, | ||
| title: "Map theme profiles", | ||
| description: | ||
| "Choose the active theme here. You can also set the default profile for new strategies.", | ||
| child: _ThemeProfilesSection(), | ||
| ), | ||
| ], | ||
| ); | ||
| } |
There was a problem hiding this comment.
Redundant single-child
Column wrapper
MapThemeSettingsSection.build returns a const Column whose children list contains only one widget — the SettingsScopeCard. The Column adds no layout value here: SettingsScopeCard already manages its own CrossAxisAlignment.start column internally. Returning the card directly would simplify the tree by one node.
| Widget build(BuildContext context) { | |
| return Column( | |
| return const Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| SettingsScopeCard( | |
| scope: SettingsScope.strategy, | |
| title: "Map theme profiles", | |
| description: | |
| "Choose the active theme here. You can also set the default profile for new strategies.", | |
| child: _ThemeProfilesSection(), | |
| ), | |
| ], | |
| ); | |
| } | |
| Widget build(BuildContext context) { | |
| return const SettingsScopeCard( | |
| scope: SettingsScope.strategy, | |
| title: "Map theme profiles", | |
| description: | |
| "Choose the active theme here. You can also set the default profile for new strategies.", | |
| child: _ThemeProfilesSection(), | |
| ); | |
| } |
There was a problem hiding this comment.
Pull request overview
This PR updates the Settings UI to remove duplicated map-theme headings by consolidating the theme/profile header into a single “Map theme profiles” section, while also reorganizing the broader Settings layout into scoped, card-like sections for strategy vs workspace settings.
Changes:
- Collapse the prior “Map themes” + “Theme profiles” stacked headers into a single “Map theme profiles” header via a scoped section wrapper.
- Restructure
SettingsTabinto grouped sections (strategy sizing, workspace map visibility, theme profiles) with new tile components. - Introduce
SettingsScopeCardto standardize section titles/descriptions and indicate whether settings are strategy- or workspace-scoped.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/widgets/settings_tab.dart | Rebuilds the Settings tab layout into scoped sections with custom slider/toggle tiles and includes the theme settings section. |
| lib/widgets/settings_scope_card.dart | Adds a reusable section header/description component with a scope indicator (strategy/workspace). |
| lib/widgets/map_theme_settings_section.dart | Consolidates map-theme headers into a single scoped “Map theme profiles” header and adjusts theme/profile section layout/styling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _SettingLeadingIcon( | ||
| icon: icon, | ||
| accentColor: const Color(0xff4b8f86), | ||
| ), |
| value: strategySettings.agentSize, | ||
| min: Settings.agentSizeMin, | ||
| max: Settings.agentSizeMax, | ||
| divisions: 15, | ||
| accentColor: Settings.tacticalVioletTheme.primary, | ||
| onChanged: (value) { | ||
| ref | ||
| .read(strategySettingsProvider.notifier) | ||
| .updateAgentSize(value); | ||
| }, |
| return ShadSheet( | ||
| title: Text("Settings", style: ShadTheme.of(context).textTheme.h3), | ||
| description: const Text("Adjust your application settings here."), | ||
| title: Row( | ||
| children: [ | ||
| Icon( | ||
| LucideIcons.pencil, | ||
| size: 18, | ||
| color: Settings.tacticalVioletTheme.primary, | ||
| ), | ||
| const SizedBox(width: 8), | ||
| Text("Settings", style: ShadTheme.of(context).textTheme.h3), | ||
| ], | ||
| ), | ||
| description: const Text( | ||
| "Adjust strategy sizing and workspace visibility from one place.", | ||
| ), | ||
| child: Padding( | ||
| padding: const EdgeInsets.all(8.0), | ||
| padding: const EdgeInsets.all(8), | ||
| child: SizedBox( | ||
| width: 325, | ||
| width: Settings.sideBarContentWidth, | ||
| child: Material( | ||
| child: Column( | ||
| children: [ | ||
| SettingsSection( | ||
| title: "Agents", | ||
| children: [ | ||
| const Text( | ||
| "Scale", | ||
| style: TextStyle(fontSize: 15), | ||
| ), | ||
| const SizedBox(height: 10), | ||
| Slider( | ||
| min: Settings.agentSizeMin, | ||
| max: Settings.agentSizeMax, | ||
| inactiveColor: Settings.tacticalVioletTheme.secondary, | ||
| divisions: 15, | ||
| value: ref.watch(strategySettingsProvider).agentSize, | ||
| onChanged: (value) { | ||
| ref | ||
| .read(strategySettingsProvider.notifier) | ||
| .updateAgentSize(value); | ||
| }, | ||
| ) | ||
| ], | ||
| ), | ||
| SettingsSection( | ||
| title: "Abilities", | ||
| children: [ | ||
| const Text( | ||
| "Scale", | ||
| style: TextStyle(fontSize: 15), | ||
| ), | ||
| const SizedBox(height: 10), | ||
| Slider( | ||
| min: Settings.abilitySizeMin, | ||
| max: Settings.abilitySizeMax, | ||
| inactiveColor: Settings.tacticalVioletTheme.secondary, | ||
| divisions: 15, | ||
| value: ref.watch(strategySettingsProvider).abilitySize, | ||
| onChanged: (value) { | ||
| ref | ||
| .read(strategySettingsProvider.notifier) | ||
| .updateAbilitySize(value); | ||
| }, | ||
| ) | ||
| ], | ||
| ), | ||
| SettingsSection( | ||
| title: "Map", | ||
| children: [ | ||
| Row( | ||
| mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| color: Colors.transparent, | ||
| child: SingleChildScrollView( | ||
| child: Column( | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: [ |
lib/widgets/settings_scope_card.dart
Outdated
| Text( | ||
| '$description ${_scopeDescription(scope)}', | ||
| style: ShadTheme.of(context).textTheme.small.copyWith( | ||
| color: Colors.white.withValues(alpha: 0.7), |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
Map themes+Theme profilesheading pair with a singleMap theme profilesheaderTesting
export PATH="/home/ubuntu/fvm/bin:/home/ubuntu/fvm/versions/3.41.1/bin:$PATH" && fvm flutter analyze lib/widgets/map_theme_settings_section.dart