Skip to content

Keep a shared .ica's map colors when the profile isn't here - #248

Merged
SunkenInTime merged 1 commit into
mainfrom
t3code/ica-theme-colors
Oct 4, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
t3code/ica-theme-colors

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

When someone shares a .ica whose strategy uses one of their custom map themes, the receiver sees it in Default colors. The file carries the right colors; import just ignored them.

The same shared .ica imported before and after

Reproduction

  1. On machine A, make a custom map theme profile, set a strategy to it, and export the .ica.
  2. On machine B, which doesn't have that profile, import the file.
  3. Expected: the strategy draws in A's colors. Actual: Default colors.

Export writes both themeProfileId and themePalette. Import kept the id whenever one was present and threw away the palette. B has no profile with that id, so the strategy fell back to Default.

The fix

_importStrategyFile now checks whether the profile id exists on this machine. If it doesn't and the file has a palette, the strategy keeps that palette as its own colors (the "Custom, this strategy only" state, themeOverridePalette) and drops the dangling id. If the profile exists, nothing changes. Nothing changes either when the file has no palette, as with old exports: the id is kept, as before.

  • Library backups are unaffected. They create the backed-up profiles before importing strategies, so the ids resolve.
  • Built-ins are unaffected: every store has them, so a Valorant-themed .ica still points at Valorant.
  • Built-ins from newer builds are covered: a strategy using one (such as Lotus Moss from Add Lotus Moss as a built-in map theme #247) opened in a build without it now shows its real colors instead of Default.

No schema, Hive, or Convex change.

Not covered here

Cloud strategies sync only the profile id, not the profile's colors. A cloud strategy using a custom profile still shows Default colors on a device without that profile. Fixing that means syncing profiles or the palette, which is a separate change.

Verification

  • New test: export a strategy that uses a custom profile, delete the profile, import the file. The strategy gets the file's palette and no profile id. It fails on main: the dangling id is kept.
  • New test: a .ica using the Valorant built-in still imports pointing at Valorant.
  • Real editor captures from a throwaway widget-test harness: export a strategy using a custom profile, delete the profile, import the file, open it. "Before" is main's importer; "after" is this branch, same harness.
  • flutter analyze on the touched files: no issues. flutter test: 1576 passed. Two heavy tests unrelated to import (the op-queue byte cap, loading geometry for every map) hit their 30-second timeouts on a busy machine; CI runs them.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

No blocking issue was found; this change is safe to merge based on the behavior checked.

What we checked:

  • A focused contract-validation test imported a shared .ica with a missing theme profile, reloaded the strategy from Hive, exported it, and reimported it. T-Rex
  • Against the parent commit, re-export replaced the custom palette with default colors. T-Rex
  • With this change, the custom palette remained intact throughout the round trip. T-Rex
  • Before: the imported strategy retained a missing profile ID with no override; after re-export, the default palette was written, and the custom palette remained intact at every observed stage. T-Rex

Summary

The .ica import now preserves exported map colors when the referenced theme profile is unavailable locally. Available profiles retain their ID-based linkage. The missing-profile palette survived import, Hive reload, export, and reimport in the focused check.

Reviews (1) · Last reviewed commit: "Keep a shared .ica's map colors when the..."

Export writes the strategy's profile id and its palette. Import kept the
id whenever one was present and dropped the palette, so a strategy using
someone else's custom profile drew in Default colors. When the id doesn't
exist on this machine and the file has a palette, the strategy now keeps
the palette as its own colors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 63d1c565-b36e-46ea-a56d-109a7a093669
📥 Commits

Reviewing files that changed from the base of the PR and between a91f179 and e95f98b.

📒 Files selected for processing (2)
  • lib/strategy/strategy_import_export.dart
  • test/strategy_folder_import_test.dart
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@SunkenInTime
SunkenInTime merged commit d3850be into main Oct 4, 2026
14 checks passed
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