Fix material i18n fallback and published-project polish#39
Merged
pablojimeno merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
Pilot users surfaced two regressions: - Materials viewed in `es`/`it`/`el` showed empty sections after a facilitator edited the entry in `en`, because the form persisted blank strings into other locale slots and the read helper's `||` did not fall through truthy empty strings. Read side now uses `.presence`; the Translatable concern compacts blank slots from every translation column before validation, fixing the same latent issue across all models that use it. - The published-project page rendered the challenge as a small "C6" pill, user-uploaded inline images could overflow the column, and Trix's `<div>`-as-paragraph markup combined with a redundant `prose` wrapper produced inconsistent spacing. The challenge now renders as the shared challenge card in a new `:public` mode (links to the challenges index, hides bookmark and curator-edit affordances). Inline image figures are clamped to container width with restored caption styling, and the redundant `prose` wrapper around `process_summary` is gone in favour of the existing `.trix-content` rules. Spec: `.munkit/specs/2026-05-08-post-pilot-fixes/`.
3 tasks
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.
Summary
Pilot-feedback bug fixes spanning two surfaces.
Materials — When a facilitator edited a material in English, viewers in
es/it/elsaw the prose sections disappear entirely (heading and all),because the form persisted blank strings into the other locale slots and
materials_helper#material_proseused||which doesn't fall throughtruthy empty strings. Fixes:
material_proseandmaterial_meta_descriptionuse.presenceso empty/ whitespace-only locale slots fall through to the English value.
Translatableconcern now drops blank locale slots before validationfor every translation column on every model that uses the concern, so the
JSONB column never accumulates
{ "es" => "" }noise from forms again.Published project page (
/published/:slug) — three cosmetic regressions:C6-style pill. Now renders the sharedchallenges/_card.html.erbpartial, which gained amode:local. In thenew
:publicmode the question links to the challenges index (no Turbopreview drawer) and the bookmark + curator-edit affordances are hidden.
caption styling. Added scoped CSS for
.trix-content figure.attachmentthat clamps the image to the container width and restores figure margins.
prose prose-stone max-w-nonewrapper aroundprocess_summary. ActionText already wraps its output in<div class="trix-content">, and the existing.trix-content > * + *rule provides paragraph spacing without conflicting with
prose.Spec lives at
.munkit/specs/2026-05-08-post-pilot-fixes/.Test plan
bin/rails test(734 runs, 0 failures)bundle exec rubocop(clean)edited in English, confirm sections render with English fallback content
(heading + body)
/published/<slug>for a projectwith a challenge — challenge card renders, click goes to
/challenges,no bookmark icon, inline images sit inside the column, multi-paragraph
summary has visual spacing between paragraphs