Skip to content

use minimagick for image processing#252

Merged
CulmoneY merged 2 commits intomainfrom
alec/fix-journal-images
Apr 2, 2026
Merged

use minimagick for image processing#252
CulmoneY merged 2 commits intomainfrom
alec/fix-journal-images

Conversation

@hari-co
Copy link
Copy Markdown
Contributor

@hari-co hari-co commented Mar 16, 2026

TL;DR

Briefly describe what this PR does and why it is needed. Include any relevant background or context.


Fix journal image display after leaving the journal creation/edit page.

What is this PR trying to achieve?

Explain the main goal or problem this PR addresses. What functionality, bug fix, or improvement does it introduce?


Bug fix.

How did you achieve it?

Describe the approach, implementation details, or key changes made. Mention any libraries, refactors, or design choices involved.


Use mini magick.

Before:
image

After:
image

Checklist

  • Changes have been top-hatted locally
  • Tests have been added or updated
  • Documentation has been updated (if applicable)
  • Linked related issues

@hari-co hari-co requested review from CulmoneY, Copilot and pranavrao145 and removed request for Copilot March 16, 2026 23:55
Copy link
Copy Markdown
Contributor

@CulmoneY CulmoneY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also use minimagick to resize/compress the images?

Copilot AI review requested due to automatic review settings March 24, 2026 22:26
@hari-co hari-co force-pushed the alec/fix-journal-images branch from ae9f7ae to e6dcadd Compare March 24, 2026 22:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches Active Storage variant processing to MiniMagick and introduces/report-polishes a richer report editing workflow (journals + aggregated data), alongside several UI/i18n updates to improve layout and presentation.

Changes:

  • Configure Active Storage to use MiniMagick and adjust blob image variant options.
  • Add ReportsController#update, a full reports/edit page, and a Stimulus-powered journal picker via a new journals#form_card Turbo Stream endpoint.
  • Add report seed data and expand i18n/UI tweaks across projects, log entries, and marquee behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Show a summary per file
File Description
config/application.rb Sets Active Storage variant processor to :mini_magick.
app/views/active_storage/blobs/_blob.html.erb Adds variant saver options (strip/quality/interlace) for rendered blobs.
app/controllers/reports_controller.rb Implements report edit context + update for journals/aggregated data.
config/routes.rb Adds reports#update and journals#form_card member route.
app/views/reports/edit.html.erb New report editor UI (aggregated data + journal selection modal).
app/javascript/controllers/report_editor_controller.js Stimulus controller to add/remove aggregated data and fetch journal cards via Turbo Stream.
app/controllers/journals_controller.rb Adds form_card Turbo Stream action to render a journal card partial for the report editor.
app/views/journals/form_card.turbo_stream.erb Turbo Stream append of selected journal card + hidden field.
test/controllers/reports_controller_test.rb Adds route auth coverage for update + functional update tests.
db/seeds/reports.rb, db/seeds.rb Adds report seeding and wires it into dev seeds.
app/components/reports/* Updates marquee + journal/aggregated datum card presentation.
app/javascript/controllers/marquee_controller.js / app/components/reports/marquee_component.html.erb Adds pause toggle + changes hover behavior and clone count.
app/controllers/projects/subprojects/log_entries_controller.rb Changes successful create response handling for turbo/html.
config/locales/en/*.yml, config/locales/es/*.yml Adds report edit/update strings and adjusts several existing keys.
app/assets/tailwind/application.css Theme tweaks + shared enter animations.
app/assets/images/icons/close.svg Adds a new close icon asset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 2 to +3
<% if blob.representable? %>
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [800, 600] : [1024, 768]) %>
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [800, 600] : [1024, 768], saver: { strip: true, quality: 80, interlace: true }) %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code here will only add the compression when displaying the image. Whilst I think the interlace is benefical, I was thinking to add additional code to compress the images on save.

Store compressed original (e.g., max 1920px, quality 80)

@CulmoneY CulmoneY merged commit 05de9b9 into main Apr 2, 2026
7 checks passed
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.

3 participants