Skip to content

feat: Automatically clean up temporary videos between batches - #51

Merged
khlebobul merged 1 commit into
mainfrom
cache_cleanup_update
Oct 14, 2026
Merged

khlebobul merged 1 commit into
mainfrom
cache_cleanup_update

Conversation

@khlebobul

@khlebobul khlebobul commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

What changed

  • Automatically remove each batch’s temporary videos and previews after leaving the compression screen, once active operations finish. Gallery videos remain untouched.
  • Remove completed and partial outputs on cancellation while keeping imported videos available for retry.

Checklist

  • dart format .
  • flutter analyze
  • flutter test

Summary by CodeRabbit

  • New Features
    • Temporary videos and previews are cleaned up when you leave a compression session; videos saved to your gallery are retained.
    • Cancelling a batch removes completed and partial outputs while keeping imported videos available to retry.
  • Improvements
    • Leaving the screen is blocked while a save is in progress, helping prevent interrupted saves.
    • The bitrate slider now has a diamond-shaped thumb, and the comparison action uses an icon.
  • Release
    • Updated the app to version 1.0.12.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 47eaa358-0b3a-4378-b342-cfa0127d137c
📥 Commits

Reviewing files that changed from the base of the PR and between 49e2f66 and 5218797.

⛔ Files ignored due to path filters: 1
  • assets/icons/vs.svg is excluded by !**/*.svg
📒 Files selected for processing: 28
  • CHANGELOG.md
  • README.md
  • android/app/src/main/kotlin/com/example/minimo_video/MainActivity.kt
  • docs/SKILLS.md
  • docs/skills/core/architecture.md
  • docs/skills/core/settings.md
  • docs/skills/core/testing.md
  • docs/skills/features/changelog.md
  • docs/skills/features/compression.md
  • docs/skills/features/platform.md
  • docs/skills/features/results-and-errors.md
  • docs/skills/ui/design-system.md
  • ios/Runner.xcodeproj/project.pbxproj
  • ios/Runner/SceneDelegate.swift
  • lib/constants/app_icons.dart
  • lib/features/compression/bloc/compress_bloc.dart
  • lib/features/compression/data/video_compressor_adapter.dart
  • lib/features/compression/presentation/compress_screen.dart
  • lib/features/compression/presentation/widgets/bitrate_picker.dart
  • lib/features/compression/presentation/widgets/compression_result_view.dart
  • lib/services/app_cache_service.dart
  • lib/services/changelog_service.dart
  • pubspec.yaml
  • test/features/compression/compression_result_view_test.dart
  • test/features/compression/session_cleanup_test.dart
  • test/features/compression/video_compressor_cancellation_test.dart
  • test/services/app_cache_service_test.dart
  • test/services/changelog_service_test.dart

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

📝 Walkthrough

The release adds tracked cleanup for compression-session files, cancellation handling for active compression and picker imports, and updates to compression controls. It also advances the app version to 1.0.12+31 and adds localized changelog notes.

Changes: Compression session lifecycle

Layer / File(s) Summary
Compression cancellation and native output cleanup
lib/features/compression/data/video_compressor_adapter.dart, test/features/compression/video_compressor_cancellation_test.dart, docs/skills/features/compression.md
The adapter tracks active compression, waits for it to finish during cancellation, checks cancellation during preparation and media lookup, and removes the expected iOS temporary MP4. Tests cover cancellation during native compression and media lookup.
Session file ownership and exit cleanup
lib/features/compression/bloc/compress_bloc.dart, lib/services/app_cache_service.dart, lib/features/compression/presentation/compress_screen.dart, lib/features/compression/presentation/widgets/compression_result_view.dart, test/features/compression/session_cleanup_test.dart, test/services/app_cache_service_test.dart, docs/skills/core/*, docs/skills/features/results-and-errors.md
The bloc tracks session files and active file operations. On close, it waits for those operations and removes tracked files. Cancellation removes outputs while retaining imported sources. Saving blocks exit, and sharing runs as a tracked operation. Tests cover cleanup timing, retained sources, and unrelated files.
Picker import cleanup across platforms
android/app/src/main/kotlin/com/example/minimo_video/MainActivity.kt, ios/Runner/SceneDelegate.swift, lib/features/compression/presentation/compress_screen.dart, docs/skills/features/platform.md
Android and iOS picker flows remove stale imports. Android removes batch copies after cancellation or errors and reserves cache names atomically. iOS uses UUID-prefixed names and removes partial copies after errors. The screen removes picked files if it has been disposed.
Compression result and bitrate controls
lib/constants/app_icons.dart, lib/features/compression/presentation/widgets/bitrate_picker.dart, lib/features/compression/presentation/widgets/compression_result_view.dart, test/features/compression/compression_result_view_test.dart, docs/skills/ui/design-system.md, docs/skills/features/compression.md
The bitrate slider thumb changes to a surface-filled outlined shape. The comparison action uses the VS icon, and its test finds the action by icon.
Release 1.0.12 version and notes
pubspec.yaml, ios/Runner.xcodeproj/project.pbxproj, lib/services/changelog_service.dart, test/services/changelog_service_test.dart, CHANGELOG.md, docs/skills/features/changelog.md, docs/SKILLS.md, README.md
The package and iOS project versions advance to 1.0.12+31. The release adds localized changelog entries and updates release documentation and credits.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CompressBloc
  participant VideoCompressorAdapter
  participant AppCacheService
  CompressBloc->>VideoCompressorAdapter: cancelCompression
  VideoCompressorAdapter-->>CompressBloc: active compression completes
  CompressBloc->>CompressBloc: wait for active file operations
  CompressBloc->>AppCacheService: removeFiles with tracked session paths
Loading
Merge Risk: ⚪ Minimal · up to 52187

The reviewed cleanup paths do not show a remaining issue that should delay merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (26 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: automatic cleanup of temporary videos between compression batches.
Description check Passed The description includes the required What changed and Checklist sections. It explains the cleanup behavior, preserves gallery and imported videos as required, and reports all required checks as compl…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. (26 skipped: 26 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@khlebobul
khlebobul merged commit 9f47a8f into main Oct 14, 2026
2 checks passed
@khlebobul
khlebobul deleted the cache_cleanup_update branch October 14, 2026 05:30
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.

1 participant