Repository navigation
feat(asset): enhance file dialog with initial directory and output pa… - #403
Conversation
|
Warning Review limit reached
More reviews will be available in 52 minutes and 21 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the 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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe asset pack builder now opens a save dialog for output selection, validates the chosen pack path, tracks whether the built pack exists, and conditionally reveals that output in the system file manager using new Linux and Windows support. ChangesAsset pack output and reveal flow
Sequence DiagramssequenceDiagram
participant AssetPackBuilderPanel
participant FileDialogs_SaveFile as FileDialogs::SaveFile
participant ValidateOutputPath
AssetPackBuilderPanel->>FileDialogs_SaveFile: SaveFile("*.olopack", initialDirectory)
FileDialogs_SaveFile-->>AssetPackBuilderPanel: selected path or cancel
AssetPackBuilderPanel->>ValidateOutputPath: validate selected path
ValidateOutputPath-->>AssetPackBuilderPanel: accepted path or invalid
sequenceDiagram
participant AssetPackBuilderPanel
participant FileDialogs_ShowInFileManager as FileDialogs::ShowInFileManager
participant LaunchDetached
participant xdg_open as xdg-open
participant ShellExecuteW
AssetPackBuilderPanel->>FileDialogs_ShowInFileManager: ShowInFileManager(m_LastBuildResult.m_OutputPath)
alt Linux
FileDialogs_ShowInFileManager->>LaunchDetached: launch xdg-open target
LaunchDetached->>xdg_open: execvp target
else Windows
FileDialogs_ShowInFileManager->>ShellExecuteW: explore or /select
end
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@OloEditor/src/Panels/AssetPackBuilderPanel.cpp`:
- Around line 150-187: The Asset Pack output-path handling duplicates the same
normalization, buffer copy, and validation flow in both the dialog branch and
the InputText handler. Refactor the repeated logic in
AssetPackBuilderPanel::ValidateOutputPath and the output-path update path into a
small shared helper such as ApplyOutputPath(std::string path), then call it from
both entry points so .olopack normalization, m_OutputPathBuffer writes, and
m_BuildSettings.m_OutputPath updates stay consistent.
- Around line 179-186: The output path handling in AssetPackBuilderPanel is
silently truncating long paths, which can leave the displayed buffer out of sync
with the validated/stored value. Update the logic in the output-path update
paths (including the handler that writes m_OutputPathBuffer and the manual-entry
path) to reject any selected input that does not fit in m_OutputPathBuffer
instead of memcpy’ing a truncated string. Ensure ValidateOutputPath and
m_BuildSettings.m_OutputPath only accept the same exact, non-truncated path that
m_OutputPathBuffer.data() will later provide to StartBuild().
In `@OloEngine/src/Platform/Linux/LinuxPlatformUtils.cpp`:
- Around line 292-304: LaunchDetached currently hides grandchild execvp failures
because the intermediate child exits 0 as soon as the second fork succeeds, so
the caller can’t tell when the actual launch fails. Update LaunchDetached in
LinuxPlatformUtils.cpp to propagate the grandchild’s exec result back to the
parent, for example by using a close-on-exec pipe or another status handoff
between the intermediate child and the grandchild. Make sure ShowInFileManager
can observe a failed launch so its error path for xdg-open can fire when execvp
fails.
In `@OloEngine/src/Platform/Windows/WindowsPlatformUtils.cpp`:
- Around line 102-113: The Windows file-manager launch paths in
WindowsPlatformUtils::OpenInFileManager (the ShellExecuteW calls for opening a
directory or selecting a file) ignore launch failures, so add return-value
checks for both calls and emit a diagnostic when the HINSTANCE result is <= 32;
keep the existing directory-vs-file behavior, but surface a warning/error
consistent with the documented contract and the Linux backend when Explorer
cannot be launched.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 0985a97a-f435-4437-83a5-c0ee5051df17
📒 Files selected for processing (4)
OloEditor/src/Panels/AssetPackBuilderPanel.cppOloEngine/src/OloEngine/Utils/PlatformUtils.hOloEngine/src/Platform/Linux/LinuxPlatformUtils.cppOloEngine/src/Platform/Windows/WindowsPlatformUtils.cpp
- ValidateOutputPath: strip drive-letter root-name before the invalid-char scan so absolute Windows paths from the Save dialog validate (Build button no longer stuck disabled after Browse) - Extract ApplyOutputPath helper shared by text entry and the Browse dialog; reject over-long paths instead of truncating the buffer - WindowsPlatformUtils::ShowInFileManager: warn on ShellExecuteW failure - ValidateOutputPath: error_code exists() so it can't throw from the UI loop
🤖 Self-review (finish-pr) @
|
…th validation
Summary by CodeRabbit