Skip to content

Redesign settings and unify map theming - #123

Merged
SunkenInTime merged 3 commits into
mainfrom
settings-map-theme-redesign
Aug 10, 2026
Merged

Redesign settings and unify map theming#123
SunkenInTime merged 3 commits into
mainfrom
settings-map-theme-redesign

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What

A ground-up pass on the settings dialog plus a consolidation of all map-theme workflows into one place with a live-preview editor.

Settings dialog

  • Responsive sizing (up to 1080×820, scales with the window) instead of fixed 860×640
  • Type hierarchy from scale, not weight: no more w700/w800 or all-caps labels
  • Semantic icon accents (Settings.settings*Accent) — the violet action hue stays reserved for commands/selection
  • Sidebar rebuilt on InkWell (transparency Material) — reliable hover, pressed states, and pointer cursors; no more stuck highlights from hand-rolled MouseRegion state
  • Mode switches swap content instantly and snap scroll; within-pane jumps still animate
  • Consistent vertical rhythm: section gap > row gap > title-to-group gap; slider dead-space trimmed

Map theming, unified

  • The App-wide "Theme profiles" section is gone. Current strategy → Map theme is now the single home: one profile list where the check = this strategy's theme, with management (set default, rename, edit, delete) in each row's context menu
  • New editor dialog with live preview: the actual current map (dot grid + gradient backdrop, same composition as the canvas) re-renders as you drag the color picker. Three modes — create profile / edit profile / customize strategy — each with one primary verb
  • Per-strategy overrides are labeled "This strategy only", can be promoted to a saved profile from the row, and discarding them (by picking a profile) asks for confirmation
  • Built-in profiles are tagged "Built-in" to explain their restricted menu
  • Extracted the duplicated SVG ColorMapper from interactive_map.dart and screenshot_view.dart into map_svg_color_mapper.dart, shared by canvas, exporter, and preview

Data safety

No Hive schema, migration, or serialization changes. Profiles/overrides persist exactly as before; .ica round-trip untouched.

Testing

  • flutter analyze clean (one pre-existing deprecation in pages_bar.dart)
  • Full test suite: same 3 pre-existing failures as base commit (cursor_glyph_debug, update_checker, windows_desktop_update_controller), none related
  • Manually exercised throughout by @SunkenInTime with iterative design review

Summary by CodeRabbit

  • New Features

    • Added a map theme editor for creating, editing, and customizing map profiles.
    • Added live map previews with base, detail, and highlight color controls.
    • Added profile naming, selection, strategy customization, validation, and save feedback.
    • Added clearer profile indicators, tags, hover states, and profile actions.
  • Improvements

    • Consolidated map theme management into a simpler profile list.
    • Updated settings navigation, responsive dialogs, layouts, icons, and controls.
    • Improved confirmation when changing profiles with unsaved customizations.
    • Refined settings cards and optional descriptions for cleaner presentation.

Settings dialog: responsive sizing, scale-based type hierarchy (no
bold/uppercase emphasis), semantic icon accents, InkWell-backed nav
with reliable hover and click cursors, and consistent vertical rhythm.

Map theming now lives in one place: a single profile list under
Current strategy with inline management, plus a live-preview editor
dialog (real map + dot grid re-rendered as colors change). Strategy
overrides are labeled "This strategy only", promotable to profiles,
and guarded by a confirm before being discarded. Built-in profiles
are tagged. The duplicated SVG color mapper is extracted and shared
by the canvas, screenshot exporter, and preview.
@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@SunkenInTime, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a61848f9-e2b0-4ffe-9d61-585d008f4e02

📥 Commits

Reviewing files that changed from the base of the PR and between 222a7ba and 5f85c80.

📒 Files selected for processing (4)
  • lib/providers/user_preferences_provider.dart
  • lib/widgets/dialogs/map_theme_editor_dialog.dart
  • lib/widgets/map_theme_settings_section.dart
  • lib/widgets/settings_tab.dart
📝 Walkthrough

Walkthrough

The change adds shared map palette mapping and a profile editor. It integrates profile management into the settings UI, removes embedded editors, and revises settings layout, navigation, colors, controls, and card descriptions.

Changes

Map theme and settings experience

Layer / File(s) Summary
Shared map palette mapping
lib/widgets/map_svg_color_mapper.dart, lib/interactive_map.dart, lib/screenshot/screenshot_view.dart
Adds shared source-color mapping with opacity preservation and applies it to interactive maps and screenshots.
Map theme editor workflow
lib/widgets/dialogs/map_theme_editor_dialog.dart
Adds profile creation, profile editing, and strategy customization with previews, color editing, validation, persistence, and strategy overrides.
Unified map theme settings
lib/widgets/map_theme_settings_section.dart, lib/widgets/settings_tab.dart
Moves profile management into one Riverpod-backed section, opens the shared editor, displays profile state and tags, and confirms discarded strategy overrides.
Responsive settings layout and controls
lib/const/settings.dart, lib/widgets/settings_tab.dart, lib/widgets/settings_scope_card.dart
Adds semantic accent colors, responsive settings dimensions, simplified navigation, compact slider and toggle tiles, revised typography, and optional card descriptions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SettingsTab
  participant MapThemeSettingsSection
  participant MapThemeEditorDialog
  participant MapThemeProvider
  participant StrategyProvider
  SettingsTab->>MapThemeSettingsSection: render map theme settings
  MapThemeSettingsSection->>MapThemeEditorDialog: open with selected mode and palette
  MapThemeEditorDialog->>MapThemeProvider: create or update profile
  MapThemeEditorDialog->>StrategyProvider: apply strategy palette override
  MapThemeEditorDialog-->>MapThemeSettingsSection: close and report outcome
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: redesigning settings and consolidating map theming.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch settings-map-theme-redesign

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The settings redesign centralizes map-theme profile management, strategy-specific palette customization, and shared SVG palette rendering. Focused persistence coverage confirmed that profile selections and per-strategy overrides restore correctly, switching back to a profile clears the override, and no strategy record is created when no strategy is open.

Confidence Score: 5/5

No blocking failure remains.

No accepted blocking findings remain after exercising the map-theme persistence and restoration paths.

T-Rex T-Rex Logs

What T-Rex did

  • Authored the map-theme persistence harness for PR123, enabling focused tests of profile and palette persistence.
  • Executed the Flutter test for the map-theme persistence harness from the repository, which finished with exit code 0 and all checks passing.
  • Confirmed that saved profile selection persists across save/restore, a strategy override persists as the effective palette, selecting a profile clears an existing override, and no active strategy yields no persisted strategy.
  • Attached and reviewed the focused map-theme persistence test output showing a passing result.
  • Captured paired before and after logs for the test to document reproducibility and provide evidence of the test's run-state transitions.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "Make profile write results honest" | Re-trigger Greptile

Comment thread lib/widgets/dialogs/map_theme_editor_dialog.dart

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
lib/widgets/map_svg_color_mapper.dart (1)

13-41: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Add value equality to MapSvgColorMapper.

flutter_svg includes the ColorMapper in its cache key, so each build()-time instance misses cached SVGs even when replacements is the same. Implement == and hashCode over replacements so identical palette mappers reuse cached parsed SVGs, especially during preview color-picker rebuilds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/widgets/map_svg_color_mapper.dart` around lines 13 - 41, Implement
value-based == and hashCode on MapSvgColorMapper using its replacements map, so
instances with identical mappings compare equal and produce the same hash.
Preserve the existing substitute behavior and constructor APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/widgets/dialogs/map_theme_editor_dialog.dart`:
- Around line 397-417: The _saveProfileEdits flow currently reports success even
when renameProfile or updateProfilePalette rejects invalid input. Update these
provider methods to return an explicit success/failure result or throw for
invalid names, then have _saveProfileEdits detect a rejected name and avoid
popping or showing “Profile updated.”; retain the success flow when the palette
update succeeds and no name change is requested.

In `@lib/widgets/map_theme_settings_section.dart`:
- Around line 63-69: Update the override “Custom” row in the map theme settings
section to pass onTap: null instead of a no-op callback. In
_ProfileListRow.build, reserve and render the check column based on isSelected
rather than onTap, while keeping the selected check mark and row alignment
unchanged.

In `@lib/widgets/settings_tab.dart`:
- Around line 69-87: Clamp dialogWidth and dialogHeight in SettingsTab to
positive minimums exceeding the 208 px navigation rail plus 48 px padding,
preserving the existing maximum constraints. Apply the same positive-floor
clamping in lib/widgets/dialogs/map_theme_editor_dialog.dart at lines 96-116,
using a minimum above the 340 px control pane or making that pane flexible.

---

Nitpick comments:
In `@lib/widgets/map_svg_color_mapper.dart`:
- Around line 13-41: Implement value-based == and hashCode on MapSvgColorMapper
using its replacements map, so instances with identical mappings compare equal
and produce the same hash. Preserve the existing substitute behavior and
constructor APIs.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 706f4d36-aa57-4738-92a1-4ee06ef3a507

📥 Commits

Reviewing files that changed from the base of the PR and between aeefc69 and 222a7ba.

📒 Files selected for processing (8)
  • lib/const/settings.dart
  • lib/interactive_map.dart
  • lib/screenshot/screenshot_view.dart
  • lib/widgets/dialogs/map_theme_editor_dialog.dart
  • lib/widgets/map_svg_color_mapper.dart
  • lib/widgets/map_theme_settings_section.dart
  • lib/widgets/settings_scope_card.dart
  • lib/widgets/settings_tab.dart

Comment thread lib/widgets/dialogs/map_theme_editor_dialog.dart
Comment thread lib/widgets/map_theme_settings_section.dart Outdated
Comment thread lib/widgets/settings_tab.dart
…lidation

- Clamp both dialogs' responsive dimensions to positive floors so tiny
  windows can't produce negative pane widths
- The override "Custom" row is no longer fake-tappable; the check
  column now follows selection instead of tappability
- Editing a profile with an empty name shows an error instead of a
  false "Profile updated" toast
@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai review — pushed fixes for the size-clamping, override-row semantics, and rename validation; replied on the gradient thread with the canvas-fidelity rationale.

renameProfile and updateProfilePalette now return whether anything was
written instead of silently no-oping, and both callers surface the
failed outcome (including the partial colors-saved-name-rejected case)
instead of toasting a false success.
@SunkenInTime

Copy link
Copy Markdown
Owner Author

@greptileai review

@SunkenInTime
SunkenInTime merged commit aef7569 into main Aug 10, 2026
3 checks passed
@SunkenInTime
SunkenInTime deleted the settings-map-theme-redesign branch August 10, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant