feat: add compression results display and enhance multilingual support - #21
Merged
Conversation
- Introduced "Compression Results" view to display compression statistics. - Enhanced language files with new keys for displaying compression results in multiple languages. - Updated `ImageService` to return detailed compression results, including file size savings. - Added optional setting to toggle the display of compression results post-compression. - Refactored `views.rs` and `app.rs` to accommodate the new "Results" view.
There was a problem hiding this comment.
Pull request overview
Adds a post-compression “Compression Results” window and related plumbing so the app can display per-file size statistics, along with new localized strings and a user setting to enable/disable the results window.
Changes:
- Introduced a new Results window/view that lists original vs. compressed sizes and totals.
- Updated compression pipeline to return
CompressionResultdata (per file) instead of(). - Added multilingual UI keys and a new settings toggle (
show_compression_results) to control whether the results window auto-opens.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/settings_view.rs | Adds a settings checkbox to toggle showing compression results. |
| src/views/results_view.rs | New view rendering per-file compression stats, totals, and a close button. |
| src/views.rs | Registers the new results_view module. |
| src/services/theme_service.rs | Expands Rustdoc for string_to_theme. |
| src/services/image_service.rs | Introduces CompressionResult and updates compress_single to return detailed results. |
| src/models/language.rs | Adds new language keys for results UI and the new settings toggle label. |
| src/components/state.rs | Stores compression_results in app state and initializes it. |
| src/components/settings.rs | Adds show_compression_results setting and default. |
| src/components/app.rs | Adds Results window kind, new messages, and hooks to open/close results after compression. |
| languages/en_us.json | Adds strings for results UI and “show compression results” setting. |
| languages/es_es.json | Adds strings for results UI and “show compression results” setting. |
| languages/fr_fr.json | Adds strings for results UI and “show compression results” setting. |
| languages/ja_jp.json | Adds strings for results UI and “show compression results” setting. |
| languages/nl_nl.json | Adds strings for results UI and “show compression results” setting. |
| languages/pt_pt.json | Adds strings for results UI and “show compression results” setting. |
| languages/ru_ru.json | Adds strings for results UI and “show compression results” setting. |
| languages/uk_ua.json | Adds strings for results UI and “show compression results” setting. |
| languages/zh_cn.json | Adds strings for results UI and “show compression results” setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ImageServiceto return detailed compression results, including file size savings.views.rsandapp.rsto accommodate the new "Results" view.