Skip to content

Replace ProjectAccessor with currentProject for path handling#950

Merged
egorikftp merged 1 commit into
mainfrom
task/dont-remember-project-for-preview
Apr 1, 2026
Merged

Replace ProjectAccessor with currentProject for path handling#950
egorikftp merged 1 commit into
mainfrom
task/dont-remember-project-for-preview

Conversation

@egorikftp

Copy link
Copy Markdown
Member

📝 Changelog

If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs:

@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 420474d0-fd76-4538-aca9-47b555081389

📥 Commits

Reviewing files that changed from the base of the PR and between 6a06607 and 423361f.

📒 Files selected for processing (4)
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/platform/ProjectAccessor.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/tooling/PreviewTheme.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/common/IconPackDirectoryPicker.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/general/GeneralSettingsScreen.kt
🚧 Files skipped from review as they are similar to previous changes (4)
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/tooling/PreviewTheme.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/general/GeneralSettingsScreen.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/common/IconPackDirectoryPicker.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/platform/ProjectAccessor.kt

Walkthrough

Removed the @Composable rememberProjectAccessor() function and the ProjectAccessor class. Added two top-level read-only properties: currentProject (reads the first open project from ProjectManager) and currentProjectPath (reads currentProject?.basePath). Updated preview/theme and UI code to read project information directly from currentProject/currentProjectPath or LocalProject.current instead of using the remembered accessor.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes a changelog reminder template with unchecked boxes, but provides no substantive explanation of the changes, rationale, or impact. Add a clear description of what was changed and why (e.g., the refactoring removes remembered state and simplifies project access), then update the changelog boxes if user-facing changes apply.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main refactoring: replacing ProjectAccessor with currentProject for path handling, which aligns with the core changes across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/dont-remember-project-for-preview

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 and usage tips.

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/platform/ProjectAccessor.kt`:
- Around line 22-26: GeneralSettingsScreen and IconPackDirectoryPicker are using
the global currentProjectPath which can be wrong in composition-scoped UIs;
replace occurrences of currentProjectPath.orEmpty() in GeneralSettingsScreen and
IconPackDirectoryPicker with LocalProject.current?.basePath.orEmpty() so they
resolve the composition-provided project (LocalProject.current) instead of
ProjectManager.getInstance().openProjects via currentProjectPath.
🪄 Autofix (Beta)

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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: adf36986-af1c-4f7d-b756-e91b71223e28

📥 Commits

Reviewing files that changed from the base of the PR and between d0416d5 and 6a06607.

📒 Files selected for processing (4)
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/platform/ProjectAccessor.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/tooling/PreviewTheme.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/iconpack/common/IconPackDirectoryPicker.kt
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/settings/tabs/general/GeneralSettingsScreen.kt

@egorikftp egorikftp force-pushed the task/dont-remember-project-for-preview branch from 6a06607 to 423361f Compare April 1, 2026 18:58
@egorikftp egorikftp merged commit d65f462 into main Apr 1, 2026
3 checks passed
@egorikftp egorikftp deleted the task/dont-remember-project-for-preview branch April 1, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant