Skip to content

fix(profiles): preserve Space associations in single exports - #1385

Open
Belligerently wants to merge 3 commits into
thaw-app:legacy/thaw-2from
Belligerently:codex/fix-profile-space-export
Open

Belligerently wants to merge 3 commits into
thaw-app:legacy/thaw-2from
Belligerently:codex/fix-profile-space-export

Conversation

@Belligerently

@Belligerently Belligerently commented Oct 23, 2026 •

Copy link
Copy Markdown

Summary

Preserve Space bindings and labels in single-profile exports, matching Export All. Add a regression test and changelog entry. This small fix repairs ProfileManager’s existing export responsibility and adds no state or responsibilities.

Linked issue (required)

Closes: #1384

PR Type

  • Bug fix
  • CI/CD
  • Documentation
  • Feature
  • Enhancement
  • Performance improvement
  • Refactor
  • Test addition or update
  • Other

Area

  • menubar
  • icebar
  • layout
  • appearance
  • settings
  • onboarding
  • permissions
  • profiles
  • hotkeys
  • updates
  • ops

Does this PR introduce a breaking change?

  • Yes
  • No

What is the new behavior?

Single-profile export includes associatedSpaceKey and associatedSpaceName. The test exports and imports a Space-bound profile in a temporary directory, reloads the manager, and verifies its association and label persisted.

PR Checklist

  • Built and run the app interactively.
  • Ran swiftformat . and passing repository-wide strict lint.
  • Ran relevant test commands below.
  • Added regression tests.
  • Noted macOS versions tested.
  • Documented new public APIs / non-obvious helpers (none added).
  • Updated documentation as needed.
  • Targets development (Thaw 2).
  • No new responsibilities in the big types.
  • New code has at least 80% coverage and SonarCloud reports no new issues (not claimed; fork PRs skip analysis).
  • Dependency checks passed if applicable (no dependency or lockfile changes).
    Test commands run on macOS 27.2 (26B118), Xcode 27.1:
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcodebuild build-for-testing -project Thaw.xcodeproj -scheme Thaw -destination "platform=macOS" -derivedDataPath /private/tmp/thaw-space-export-build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO DISABLE_DIAMOND_PROBLEM_DIAGNOSTIC=YES

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer TEST_RUNNER_XCODE_RUNNING_FOR_PREVIEWS=1 xcodebuild test-without-building -xctestrun /private/tmp/thaw-space-export-build/Build/Products/SpaceExportIsolated.xctestrun -destination "platform=macOS,arch=arm64" -parallel-testing-enabled NO -only-testing:ThawTests/ProfileManagerCRUDTests

Build passed; all 34 profile CRUD tests passed. The xctestrun copy sets XCODE_RUNNING_FOR_PREVIEWS=1 in the test environment to skip normal app startup and live menu-bar management.

SwiftFormat 0.64.1: swiftformat . completed; unrelated formatting was restored.

SwiftLint 0.65.1: strict lint of ProfileManager.swift passed with zero violations. Repository-wide strict lint with DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer reports 11 legacy_swiftui_aspect_ratio violations in unchanged files. CI uses 0.63.3. No suppressions added.

Git diff --check passed.

Known limitations / follow-ups

No interactive app check or macOS 26 verification. Automated tests ran on macOS 27.2. Repository-wide strict lint with the CI version remains outstanding; local results are above. SonarCloud coverage and quality gate are not claimed.

Other information

AI-assisted change reviewed for scope and existing persistence semantics. No external code or dependencies added.

Summary by CodeRabbit

  • Bug Fixes
    • Exporting a single profile now preserves its associated Space, so importing it on the same Mac restores that association. The Space’s identifying information is included in the exported profile, helping ensure the imported profile remains linked to the correct Space after it is loaded. If the profile has no matching Space information, the export leaves that association unset.

Signed-off-by: Belligerently <zachary@aflalo.com>
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7a452d79-14a3-4301-86a4-a4dc54b47199

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 800abdd5-db65-4867-bf0a-ca82812b13b3
📥 Commits

Reviewing files that changed from the base of the PR and between 8f596ce and b1e3808.

📒 Files selected for processing: 1
  • ThawTests/Settings/Models/ProfileManagerCRUDTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

Single-profile exports now include the profile’s associated Space key and name. A regression test checks that importing the export preserves the association after reloading the profile manager. The Unreleased changelog records the fix.

Changes: Single-profile export and import

Layer / File(s) Summary
Include and verify Space metadata
Thaw/Settings/Models/ProfileManager.swift, ThawTests/Settings/Models/ProfileManagerCRUDTests.swift, CHANGELOG.md
exportProfile(id:to:) adds the associated Space key and name to the export entry. The regression test checks the association after import and manager reload. The changelog notes the fix.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: diazdesandi

Merge Risk: Minimal · previous review b1e38

The change correctly preserves Space associations through single-profile export and reload.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description follows the repository template. It includes the summary, linked issue, PR type, area, breaking-change status, new behavior, test commands, known limitations, and other information. It…
Title check Passed The title is concise, specific, and accurately describes the primary change: preserving Space associations in single-profile exports.
Linked Issues check Passed Issue #1384 is the only directly linked issue. Its coding requirement is that single-profile export keeps associatedSpaceKey and associatedSpaceName, as Export All does, so that import on the same Mac…
Out of Scope Changes check Passed The whole-PR summary lists three changed files. ProfileManager.swift changes only the single-profile export entry by adding the two Space fields named in #1384. ProfileManagerCRUDTests.swift adds only…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files.
Full details: Description check

Explanation

The description follows the repository template. It includes the summary, linked issue, PR type, area, breaking-change status, new behavior, test commands, known limitations, and other information. It also clearly reports incomplete validation items.

Full details: Linked Issues check

Explanation

Issue #1384 is the only directly linked issue. Its coding requirement is that single-profile export keeps associatedSpaceKey and associatedSpaceName, as Export All does, so that import on the same Mac restores the Space binding and label. The whole-PR summary states that ProfileManager.exportProfile(id:to:) now adds both Space values to the exported entry, with nil values when no matching profile metadata exists. The PR description states the same behavior. The issue reports that import already supports these fields. The test ThawTests/Settings/Models/ProfileManagerCRUDTests.swift adds exportImportPreservesSpaceAssociation. It exports and imports a Space-bound profile in a temporary directory, reloads the manager, and checks the key and label. This covers the required regression test. Limit: the repository diff tool could not read the changed blobs, and the head file read was truncated before exportProfile. The verdict relies on the whole-PR summary, which is consistent across the PR description, the issue, and the previous assessment. The author reports the 34 ProfileManagerCRUDTests passed, but this review did not run them.

Full details: Out of Scope Changes check

Explanation

The whole-PR summary lists three changed files. ProfileManager.swift changes only the single-profile export entry by adding the two Space fields named in #1384. ProfileManagerCRUDTests.swift adds only the export/import/reload regression test for those fields. CHANGELOG.md adds a Fixed entry for the same behavior. No public API declaration, dependency, or other production behavior change appears in the summary. The PR description reports no new state or responsibilities. Limit: the direct diff could not be read, so the assessment depends on the summary. This does not show any unrelated change.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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.

@github-actions github-actions Bot added fix PR that fixes a defect (issue reports use bug) profiles Profiles and layout snapshots test Test additions or updates labels Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Labels: test, fix, profiles

All convention checks passed. ✅

cc @Belligerently

Signed-off-by: Belligerently <zachary@aflalo.com>

@diazdesandi diazdesandi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Resolve conflicts so I can merge

Signed-off-by: Belligerently <zachary@aflalo.com>
@Belligerently
Belligerently force-pushed the codex/fix-profile-space-export branch from 8325f69 to e071e51 Compare October 27, 2026 14:46
@Belligerently

Copy link
Copy Markdown
Author

@diazdesandi The CHANGELOG.md conflict is resolved against legacy/thaw-2, preserving the release notes and the export fix under Unreleased. All three PR commits now show Verified signatures; the signing update did not change file contents. Could you take another look and update your review when you have a chance? The workflows are also awaiting maintainer approval. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix PR that fixes a defect (issue reports use bug) profiles Profiles and layout snapshots test Test additions or updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Exporting one profile drops its Space association

2 participants