feat(UI): require confirmation to clear shader cache#1757
Conversation
📝 WalkthroughWalkthroughThis pull request adds a confirmation dialog for shader cache clearing, introducing a persistent user setting to skip the confirmation if desired. It refactors existing clear cache actions to route through a centralized confirmation flow with UI rendering, and extends the settings structure to store the user preference. Changes
Sequence DiagramsequenceDiagram
participant User
participant MenuAction
participant Util as Util::Request/Draw
participant Settings as Menu::Settings
participant Cache as ShaderCache
User->>MenuAction: Click "Clear Shader Cache"
MenuAction->>Util: RequestClearShaderCacheConfirmation()
alt SkipClearCacheConfirmation is true
Util->>Cache: Clear cache (memory + disk)
Cache-->>Util: Done
else SkipClearCacheConfirmation is false
Util->>Util: Set showClearCacheConfirmation flag
end
Note over User,Util: Per-frame rendering loop
alt Confirmation popup is visible
Util->>Util: DrawClearShaderCacheConfirmation()
Util-->>User: Display modal with "Don't ask again" checkbox
alt User clicks "Clear Cache"
User->>Util: Confirm clear
Util->>Settings: Update SkipClearCacheConfirmation (if checkbox enabled)
Settings-->>Util: Setting persisted
Util->>Cache: PerformClearShaderCache()
Cache-->>Util: Cache cleared
Util->>Util: Close popup
else User clicks "Cancel"
User->>Util: Cancel
Util->>Util: Close popup without clearing
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details.
|
✅ A pre-release build is available for this PR: |
Add confirmation popup with "don't ask me again" checkbox when clearing cache via header buttons.
Secondary checkbox in menu so that it can be enabled/disabled without using the clear cache button.
Advanced settings button clears without confirmation.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.