Skip to content

Add bulk delete resources process and delete files option#1013

Closed
anobaka wants to merge 33 commits intomainfrom
claude/add-bulk-delete-resource-saM02
Closed

Add bulk delete resources process and delete files option#1013
anobaka wants to merge 33 commits intomainfrom
claude/add-bulk-delete-resource-saM02

Conversation

@anobaka
Copy link
Copy Markdown
Owner

@anobaka anobaka commented Mar 25, 2026

Summary

  • Add "Delete Resources" toggle to bulk modification Processes step, allowing deletion of all filtered resources when applied (no property selection needed)
  • Add "Delete Files" checkbox option to both bulk modification delete and individual resource delete operations, with a warning about resource data vs file deletion
  • Backend: IResourceService.DeleteByKeys now accepts deleteFiles parameter; BulkModification model gains DeleteResources and DeleteFiles fields

Details

Bulk Modification - Delete Resources Process

  • New toggle in the Processes section: "Delete Resources"
  • When enabled, Preview creates diff entries for all filtered resources
  • Apply deletes the resources (revert is blocked since deletion is irreversible)
  • Shows warning and optional "Delete files" checkbox

Individual Resource Delete Enhancement

  • Enhanced existing delete context menu with:
    • Warning message (shown when files exist): explains that only data is deleted and resources may reappear
    • "Also delete files" checkbox (shown when files exist, unchecked by default)

Files Changed

  • Backend: IResourceService, ResourceService, ResourceController, BulkModificationService, BulkModification models (domain/db/view/input/patch)
  • Frontend: ContextMenuItems, new DeleteResourceConfirmContent component, Processes, DiffsModal, BulkModification index, SDK types, localization (cn/en)

Note

  • DB migration not included — will be created manually (adds DeleteResources and DeleteFiles bool columns to BulkModifications table)

Test plan

  • Verify bulk modification "Delete Resources" toggle appears in Processes section
  • Verify Preview shows filtered resources with "Resource will be deleted" label
  • Verify Apply deletes resources correctly
  • Verify Revert is blocked for delete-type bulk modifications
  • Verify individual resource delete shows warning and "delete files" checkbox when files exist
  • Verify "delete files" option actually removes files from disk
  • Verify warning/checkbox are hidden when files don't exist

https://claude.ai/code/session_01HfzdGthYfwW9zh3vchfQ3W

anobaka and others added 30 commits March 24, 2026 14:12
- Add style tab in resource display settings with CSS variable sliders
- Support customizing cover border-radius, gap, and card padding
- Use left-right layout for compact slider controls
- Allow modifying resource filter operations in simple mode
- Fix font-size override on display property chips

https://claude.ai/code/session_012CHdopNPunYpK1pTbAJi4q
- Property-centric enhancer config with scenario-based grouping
- EnhancementConfigPanel with multi-select group/enhancer chips
- Per-property scope priority and property binding
- Dynamic target support with CoverSelectOrder config
- Regex enhancer: auto-sync capture groups, hide redundant DynamicTargets UI
- Fix pool=0 boundary issues: sanitize invalid PropertyPool/PropertyId at
  frontend load, submit, and display layers
- Allow modifying resource filter operations in simple mode

https://claude.ai/code/session_012AYwJu99Z2PQctNXM96UqV
…, file processor, and resource translation

resolve #998, resolve #999, resolve #1000, resolve #1001
…t toggles

- Replace single DisableCache toggle with DisableCoverCache and DisablePlayableFileCache
  in UIOptions, allowing users to independently control each cache type
- Update PrepareCacheTask to run when either cache type is enabled
- Update PrepareCache in ResourceService to skip disabled cache types
- Add RefreshResourceCache API endpoint (POST /cache/resource/{id}/refresh) that
  clears and rebuilds cache for a single resource, respecting cache toggles
- Update frontend settings UI with two separate checkboxes for cover and playable file cache
- Update ResourceCover to check disableCoverCache and PlayControl to check disablePlayableFileCache
- Add refresh cache button in resource list Operations (both aggregate and individual modes)
  and in resource DetailModal, shown only when resource has cached data
- Add localization keys for new cache toggles and refresh cache action (en/cn)

https://claude.ai/code/session_01CiDhFX2trWZAYkSg9YA3Vk
Add ability to validate enhancer configurations by selecting a resource
and running enhancement with the current (unsaved) settings. Users can
verify their enhancer setup before saving.

Backend:
- Add EnhanceResourceWithOptions to IEnhancerService for running
  enhancement with custom options
- Add POST /resource/{id}/enhancement/validate API endpoint

Frontend:
- Add EnhancerValidationModal with resource selector + validate flow
- Add "Validate Configuration" button to EnhancementConfigPanel footer
- Opens ResourceEnhancementsModal to display validation results
- Support repeated validation with result cleanup

https://claude.ai/code/session_01XtiMXv6Z4FSZV7jW5sXd6v
When reopening the EnhancementConfigPanel, instead of always defaulting
to the General group, auto-select groups that contain enhancers with
existing configuration. This prevents the confusing "no properties"
state when configured properties belong to non-General groups.

https://claude.ai/code/session_01XtiMXv6Z4FSZV7jW5sXd6v
Replace Windows-only WPF framework with cross-platform Avalonia UI:
- Replace WebView2 control with WebView.Avalonia for cross-platform web content
- Replace WinForms NotifyIcon with Avalonia TrayIcon
- Replace P/Invoke Win32 APIs (dark mode, icons, window focus) with Avalonia equivalents
- Replace WPF themes (Light.xaml/Dark.xaml) with Avalonia FluentTheme + ThemeVariant
- Convert all XAML from WPF syntax to Avalonia AXAML syntax
- Add Program.cs entry point (Avalonia requires explicit Main)
- Create AvaloniaGuiAdapter replacing WpfGuiAdapter
- Create CrossPlatformSystemService replacing WindowsSystemService
- Remove MissingWebView2Dialog (WebView.Avalonia bundles runtime)
- Remove WPF AssemblyInfo.cs (ThemeInfo attribute)
- Target net9.0 instead of net9.0-windows

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

fix: resolve compilation errors in Avalonia migration

- Add missing 'using Avalonia' in ErrorWindow.axaml.cs for Application type
- Rename TextBlock x:Name from "Title" to "ErrorTitle" to avoid conflict with Window.Title
- Fix ShowConfirmDialog: build dialog and buttons separately to avoid referencing 'dialog' before declaration
- Remove unnecessary async from ShowMainWebView (no await needed)
- Remove unused imports

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

fix: correct WebView assembly name in AXAML namespace

The WebView.Avalonia NuGet package produces assembly name 'Avalonia.WebView'
(from project file Avalonia.WebView.csproj), not 'WebView.Avalonia'.

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

fix: improve WebView error handling in ShowMainWebView

- Move MainWindow construction inside try block so AXAML parse errors
  are caught
- Null-safe close on error (window might not have been created)
- Include actual exception message in error dialog for debugging
- Reset _mainWindow to null on failure to avoid stale state

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Replace WebView.Avalonia with NativeControlHost-based WebView

WebView.Avalonia 11.0.0.1 crashes on macOS + .NET 9 due to
AmbiguousMatchException in Builder.NativeImplementationBuilder's
ObjC interop layer. The package is effectively abandoned (repo disabled).

Replace with a custom NativeWebViewHost control using Avalonia's
NativeControlHost to embed platform-native WebView engines:
- macOS: WKWebView via direct objc_msgSend P/Invoke (bypasses broken ObjCRuntime)
- Windows: WebView2 via Microsoft.Web.WebView2.Core (reflection-loaded)
- Linux: WebKitGTK via P/Invoke to libwebkit2gtk

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Fix dock icon, enable WKWebView dev tools, fix button padding

1. Dock icon: Set Window.Icon to /Assets/favicon.png in MainWindow.axaml
2. WKWebView dev tools: Enable developerExtrasEnabled on WKPreferences
   and setInspectable:YES (macOS 13.3+) for Safari Web Inspector debugging
3. Exit dialog buttons: Add Padding="0" to fix text rendering too low
   (Avalonia Fluent theme default Button padding is asymmetric: 11,5,11,6)
4. Add debug logging for Navigate URL to help diagnose blank page

To debug with Safari Web Inspector:
  Safari → Develop menu → pick the app → inspect the page

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Add debug logging to CreateNativeControlCore

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Set macOS Dock icon programmatically via NSApplication API

Non-bundled executables on macOS show generic "exec" icon. This uses
ObjC interop to load favicon.png and call setApplicationIconImage: on
NSApp. Also adds Info.plist and .icns for future .app bundle support.

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Fix WKWebView height doubling on Retina displays

Remove autoresizingMask which conflicts with NativeControlHost's own
frame management, causing the height to be doubled on Retina displays.
Add explicit SizeChanged handler to manually sync WKWebView frame.

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Improve dock icon and replace language Select with Dropdown

1. Dock icon: generate proper 1024x1024 icon with white squircle
   background and padded "B" to match macOS dock icon conventions.

2. Language selector: replace HeroUI Select with Dropdown for the nav
   bar. Trigger shows compact abbreviation ("中"/"EN"), dropdown menu
   shows full language names. Fixes truncated text in narrow sidebar.

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa

Increase language trigger button text size

Remove size="sm", add fontSize 16 and fontWeight 500 to match
surrounding icon buttons better.

https://claude.ai/code/session_01B73znyKBs3EQJnq3qH2GJa
- Replace custom OSS file-by-file updater with Velopack cross-platform auto-updates
- Remove legacy BakabaseUpdaterService and BakabaseUpdaterDiscover
- Update deploy.yml to upload Velopack releases and legacy paths for backward compatibility
  - New path: app/bakabase/releases/{rid}/ (Velopack)
  - Legacy installer zip: app/bakabase/inside-world/{version}/installer/{rid}/bakabase.zip
  - Legacy unpacked files: app/bakabase/inside-world/{version}/unpacked/win/ (for old auto-update)
- Make updater launch platform-aware with macOS quarantine handling
- Only request admin elevation when app directory requires it

https://claude.ai/code/session_01R44PgGtuYGC848pB3oEsbH
…tion

Implement multi-resource source architecture allowing resources to be linked
to multiple sources (Steam, DLsite, ExHentai, filesystem). Includes:

- ResourceSourceLink many-to-many relationship and conflict resolution
- Steam/DLsite/ExHentai API sync with multi-account support
- DLsite download/extract/play flow with DRM key support
- Resource discovery redesign using ResourceSourceLink for matching
- Playable system with multi-source icon priority
- User timezone configuration
- Avalonia cross-platform migration (WPF → Avalonia + WebView)
- AI/LLM integration with provider configuration and AI enhancer
- Enhancer configuration validation
- Split cache into cover and playable file caches
- UI style configuration with CSS variable overwrites
- Search index and property system improvements

https://claude.ai/code/session_01GkFjexwniREu9StGqE9yTY
… and update translations

- Add V230Migrator to convert legacy PlayableFilePaths (ListString) to PlayableItems (JSON) in resource cache for records missing PlayableItems data
- Mark PlayableFilePaths as [Obsolete] in both domain and DB models, scheduled for removal in v2.4
- Change menu translation for resource profile from "资源档案" to "资源配置"

https://claude.ai/code/session_01Qs2n3zcK1hZTfgYE82zrbD
…layable items, add external source features

- Remove DbValueType/BizValueType from Resource.Property constructor,
  keep as computed getters derived from PropertyType via PropertyTypeValueTypes
- Simplify FileName/Directory as computed getters from Path,
  remove RebuildPath and backing fields, add SetPath extension method
- Promote Covers/PlayableItems to first-class Resource fields with
  priority-based selection, add CoversReady/PlayableItemsReady status fields,
  rename HasMorePlayableFiles to HasMoreFileSystemPlayableItems
- Add CoverUrls/LocalCoverPaths to ResourceSourceLink for external
  cover localization, create DownloadExternalCoversTask BTask
- Add sync confirmation modal with redownloadCover option to
  Steam/DLsite/ExHentai pages with i18n support
- Create SourceMetadataMapping model and ISourceMetadataSyncService
  interface for auto-syncing external source metadata to resource properties
- Remove Steam Enhancer (replaced by source metadata sync),
  mark EnhancerId.Steam as obsolete

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
…ead of file path

The icon is embedded as AvaloniaResource, so it must be loaded via
AssetLoader.Open with avares:// URI, not from a filesystem path.

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
- Remove ShowTray/HideTray/SetTrayText/SetTrayIcon from IGuiAdapter
  (requires corresponding Bakabase.Infrastructures patch)
- Add ITrayIconController interface in Abstractions for tray icon switching
- AvaloniaGuiAdapter: manages tray natively with Avalonia resources,
  implements ITrayIconController for icon switching (favicon/tray-running)
- App.axaml.cs: creates tray on startup, wires exit to Host.TryToExit
- BTaskEventHandler: uses ITrayIconController instead of IGuiAdapter
- Remove System.Drawing.Icon dependency from tray code

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
Patch is based on Bakabase.Infrastructures dev/v2.3 branch.
Apply with: git apply 0001-Remove-tray-methods-from-IGuiAdapter-expose-TryToExi.patch

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
- App.axaml: declare TrayIcon with menu items (Open/Exit) in XAML
- App.axaml.cs: resolve XAML tray icon, wire events after Host creation
- AvaloniaGuiAdapter: remove ShowTray/HideTray, keep only SetTrayIcon
  which updates the XAML-declared icon via App.AppTrayIcon

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
The WebView2 NativeControlHost requires a manifest declaring supported
OS versions, otherwise Win32NativeControlHost fails to create a child
window. Adds app.manifest with Windows 7–11 support declarations.

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
These types don't have a Name property; resolve by index/header in code-behind instead.

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
CoreWebView2Environment.CreateAsync has no parameterless overload;
the correct signature is CreateAsync(string?, string?,
CoreWebView2EnvironmentOptions?) with all-null arguments.

https://claude.ai/code/session_01JfhdSkGJLjsqv5VzRK8FA8
…erV2

- Delete CompressedFileHelper.cs (was already marked [Obsolete])
- Move FromSingleFile<T> to standalone CompressedFileGroup class
- Update IwFsCompressedFileGroup to inherit from standalone CompressedFileGroup
- Update FileController.DecompressFiles to use CompressedFileHelperV2
- Remove dead commented-out code block in FileController
- Delete redundant CompressedFileHelperTests (V2 tests already cover this)

https://claude.ai/code/session_01SQbkENY9SGRnD1ztPQ3hUA
anobaka and others added 3 commits March 25, 2026 11:47
- Add DeleteResources/DeleteFiles options to bulk modification
- Simplify DeleteResources flow: skip preview/diffs, apply directly from filtered IDs
- Disable Variables/Processes UI when DeleteResources is enabled
- Show warning when filter returns 0 results
- Hide data-only warning when deleteFiles is checked
- Add missing BTask translations for DownloadExternalCovers and SyncResources

https://claude.ai/code/session_01HfzdGthYfwW9zh3vchfQ3W
@anobaka anobaka force-pushed the claude/add-bulk-delete-resource-saM02 branch from 816ec28 to 2572ad1 Compare March 25, 2026 06:39
@anobaka anobaka closed this Mar 26, 2026
@anobaka anobaka deleted the claude/add-bulk-delete-resource-saM02 branch March 26, 2026 03:48
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.

2 participants