Conversation
There was a problem hiding this comment.
Pull request overview
This PR focuses on small cleanup improvements and dark-mode contrast fixes, plus robustness updates around file/logo previews and downloads.
Changes:
- Prevent leaked
blob:object URLs in image preview JavaScript by revoking URLs after use. - Improve dark-mode contrast for buttons/icons/sidebar header tabs via updated CSS colors.
- Harden client logo download behavior and add test coverage for clients without logos.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ghostwriter/static/js/project.js | Adds blob: URL revocation logic for image/avatar previews to reduce memory leaks. |
| ghostwriter/static/css/styles.css | Adjusts dark-theme text/icon colors for better contrast and adds sidebar header tab color. |
| ghostwriter/rolodex/views.py | Fixes docstring and returns 404 when a client has no logo path (avoids 500). |
| ghostwriter/rolodex/tests/test_views.py | Adds a regression test ensuring “no logo” returns 404. |
| ghostwriter/rolodex/templates/rolodex/client_detail.html | Appends ?view=true to client logo image URL. |
| ghostwriter/rolodex/forms_project.py | Removes a save side-effect from formset clean() logic. |
| ghostwriter/rolodex/forms_client.py | Removes a save side-effect from formset clean() logic. |
| ghostwriter/reporting/forms.py | Simplifies file input label copy. |
| ghostwriter/home/forms.py | Refactors avatar upload form layout and adds inline JS for file label updates. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #845 +/- ##
==========================================
+ Coverage 91.60% 91.62% +0.01%
==========================================
Files 373 373
Lines 21488 21520 +32
==========================================
+ Hits 19685 19717 +32
Misses 1803 1803 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR performs small cleanup and UX tweaks across Ghostwriter’s Django UI: improving dark-mode contrast, tightening file-upload UI text, preventing blob URL leaks in client-side previews, and hardening a client-logo download view against missing logos.
Changes:
- Improve object URL lifecycle handling for image/avatar previews in
project.js. - Adjust dark-mode button/icon text colors and add dark-mode styling for
.sidebar-header-tab. - Fix
ClientLogoDownloaddocstring + add 404 behavior when a client has no logo, with a matching test.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ghostwriter/static/js/project.js | Revoke blob URLs for preview images to reduce memory leaks. |
| ghostwriter/static/css/styles.css | Dark-mode contrast tweaks for buttons/icons and sidebar header tab color. |
| ghostwriter/rolodex/views.py | Handle missing client logo (ValueError) by returning 404 instead of 500; docstring fix. |
| ghostwriter/rolodex/tests/test_views.py | Add regression test ensuring “no logo” returns 404. |
| ghostwriter/rolodex/templates/rolodex/client_detail.html | Append ?view=true to client logo URL. |
| ghostwriter/rolodex/forms_project.py | Remove saving model instances during formset clean() primary auto-selection. |
| ghostwriter/rolodex/forms_client.py | Same as above for client contacts formset. |
| ghostwriter/reporting/forms.py | Shorten evidence upload label text. |
| ghostwriter/home/forms.py | Refactor avatar upload field layout/markup and inline JS for filename display. |
There was a problem hiding this comment.
Pull request overview
This PR focuses on small cleanup and UX tweaks across the Django and static front-end layers, including dark-mode contrast improvements and safer handling of uploaded/served files.
Changes:
- Prevent object-URL leaks in image preview rendering for evidence and avatar uploads.
- Improve dark-mode button/icon/sidebar header text contrast.
- Harden/extend client logo download behavior (404 handling when no logo, optional inline view with headers) and add a migration guard for orphaned
Reportrows.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ghostwriter/static/js/project.js | Reworks image preview blob URL lifecycle (create/revoke) for evidence and avatar previews. |
| ghostwriter/static/css/styles.css | Adjusts dark theme text color for buttons/icons and adds sidebar header tab color for contrast. |
| ghostwriter/rolodex/views.py | Updates client logo download view: handles missing logos safely, adds content type + headers, supports optional inline viewing. |
| ghostwriter/rolodex/tests/test_views.py | Adds coverage for the “client has no logo” path to ensure 404 instead of 500. |
| ghostwriter/rolodex/templates/rolodex/client_detail.html | Requests inline logo rendering via ?view=true for client detail display. |
| ghostwriter/rolodex/forms_project.py | Removes saving side-effects from formset clean() when auto-setting a primary contact. |
| ghostwriter/rolodex/forms_client.py | Removes saving side-effects from formset clean() when auto-setting a primary contact. |
| ghostwriter/reporting/migrations/0064_alter_report_project.py | Converts an accidental migration into an empty no-op to preserve migration history. |
| ghostwriter/reporting/migrations/0063_set_report_field_defaults.py | Adds a precondition check blocking NOT NULL enforcement if orphaned reports exist; removes arbitrary FK default. |
| ghostwriter/reporting/forms.py | Fixes file input label for= to match id_document and updates helper text. |
| ghostwriter/home/forms.py | Adjusts avatar upload widget/layout and introduces custom label + filename display handling. |
This PR includes several small adjustments to clean up some code and fix some color contrast in dark mode.