Skip to content

fix: display corrections#40

Merged
PascalRepond merged 1 commit intomainfrom
rep-dev
Jan 4, 2026
Merged

fix: display corrections#40
PascalRepond merged 1 commit intomainfrom
rep-dev

Conversation

@PascalRepond
Copy link
Copy Markdown
Owner

  • Reimplement stars in media list.
  • Fix EasyMDE dark mode styles.
  • Correct media edit template block structure for drawer compatibility with EasyMDE.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 4, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Updates adjust media UI and responsiveness, refactor asset inclusion in templates, tweak editor CSS, and change a status badge class mapping. Changes touch template partials for score rendering, base layout, media edit assets, a stylesheet, and a template-tag constant.

Changes

Cohort / File(s) Summary
Media score components
src/templates/partials/media-score-stars.html, src/templates/partials/media-score-stars-inner.html
Replaced static read-only stars with a size-aware, parameterized rendering; added inner partial to centralize star markup and conditional score-badge inclusion.
Media item UI
src/templates/partials/media-items.html
Moved score UI from header into card body; added responsive variants (stars vs badge) across breakpoints and adjusted title/contributors layout for alignment.
Media list/grid layout
src/templates/partials/media-list.html
Changed grid breakpoints: removed lg:, set 4-column at xl:, added 5-column at 2xl:.
Base template & media edit assets
src/templates/base.html, src/templates/media_edit.html
Added head_js block; shifted responsive drawer/navbar/padding breakpoints from lg: to xl:; refactored asset inclusion to use extra_css, head_js, and extra_js blocks instead of inline form.media rendering.
Editor stylesheet
src/static/css/easymde.css
Forest theme: made CodeMirror-cursor border-left-color !important (cursor styling tweak).
Status badge mapping
src/core/templatetags/media_tags.py
Updated STATUS_CLASSES: "PAUSED" now maps to "badge-primary" instead of "badge-neutral".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "fix: display corrections" is vague and generic, using non-descriptive language that doesn't clearly convey what specific display issues are being addressed. Use a more specific title that describes the primary changes, such as "Reimplement media score stars display and fix EasyMDE styling" or focus on the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description directly relates to the changeset with specific bullet points covering the main modifications: reimplemented stars, EasyMDE dark mode fixes, and template structure corrections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 157881f and e3794db.

📒 Files selected for processing (8)
  • src/core/templatetags/media_tags.py
  • src/static/css/easymde.css
  • src/templates/base.html
  • src/templates/media_edit.html
  • src/templates/partials/media-items.html
  • src/templates/partials/media-list.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/partials/media-score-stars.html

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f4e669 and 157881f.

📒 Files selected for processing (8)
  • src/core/templatetags/media_tags.py
  • src/static/css/easymde.css
  • src/templates/base.html
  • src/templates/media_edit.html
  • src/templates/partials/media-items.html
  • src/templates/partials/media-list.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/partials/media-score-stars.html
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-12-26T15:18:46.932Z
Learnt from: PascalRepond
Repo: PascalRepond/datakult PR: 21
File: src/templates/accounts/profile_edit.html:23-58
Timestamp: 2025-12-26T15:18:46.932Z
Learning: In Django projects, attributes added to a form field's widget via field.widget.attrs.update(...) in the form's __init__ are rendered when using {{ form.field }} in templates. No explicit attribute definitions are needed in the template. This applies to templates under src/templates in Django apps; ensure you update attrs in __init__ for consistent HTMX behavior.

Applied to files:

  • src/templates/media_edit.html
  • src/templates/partials/media-items.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/base.html
  • src/templates/partials/media-list.html
  • src/templates/partials/media-score-stars.html
📚 Learning: 2026-01-03T21:16:52.649Z
Learnt from: PascalRepond
Repo: PascalRepond/datakult PR: 36
File: src/templates/partials/media-items.html:67-67
Timestamp: 2026-01-03T21:16:52.649Z
Learning: In HTML templates (e.g., src/templates/partials/media-items.html), Tailwind CSS v4.1.11 supports arbitrary numeric utilities (max-w-{n}, w-{n}, h-{n}) that map to calc(var(--spacing) * n). These should be considered valid Tailwind classes and not flagged as invalid. Ensure review tooling and linters treat such numeric utilities as allowed, and apply this guidance to other HTML/template files in the repository.

Applied to files:

  • src/templates/media_edit.html
  • src/templates/partials/media-items.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/base.html
  • src/templates/partials/media-list.html
  • src/templates/partials/media-score-stars.html
📚 Learning: 2026-01-04T08:55:43.091Z
Learnt from: PascalRepond
Repo: PascalRepond/datakult PR: 36
File: src/templates/partials/media-score-badge.html:1-9
Timestamp: 2026-01-04T08:55:43.091Z
Learning: In Django projects, configuring heroicons in TEMPLATES builtins makes heroicons.templatetags.heroicons available in all templates without needing {% load heroicons %}. For template reviews in this codebase, assume heroicon tags work globally in HTML templates under templates/, so avoid requiring explicit loads. If a template still uses {% load heroicons %}, assess whether the load is unnecessary and can be removed; ensure no conflicts arise from global tags.

Applied to files:

  • src/templates/media_edit.html
  • src/templates/partials/media-items.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/base.html
  • src/templates/partials/media-list.html
  • src/templates/partials/media-score-stars.html
📚 Learning: 2025-12-27T18:00:03.595Z
Learnt from: PascalRepond
Repo: PascalRepond/datakult PR: 23
File: src/templates/partials/score-readonly.html:2-33
Timestamp: 2025-12-27T18:00:03.595Z
Learning: In src/templates/partials/score-readonly.html, the DaisyUI read-only rating pattern correctly uses `aria-current="true"` on the selected star and applies the same color class (bg-orange-400) to all star elements. DaisyUI's CSS automatically handles which stars are visually filled based on the aria-current position.

Applied to files:

  • src/templates/partials/media-items.html
  • src/templates/partials/media-score-stars-inner.html
  • src/templates/partials/media-score-stars.html
🧬 Code graph analysis (1)
src/templates/media_edit.html (3)
src/core/forms.py (1)
  • MediaForm (34-90)
src/core/views.py (1)
  • media_edit (152-187)
src/tests/core/test_views.py (1)
  • TestMediaEditView (45-119)
🔇 Additional comments (13)
src/static/css/easymde.css (1)

31-33: LGTM - Cursor visibility fix.

Adding !important to the cursor border color ensures it remains visible in the forest theme, likely resolving a specificity conflict. This is an appropriate fix for the display issue.

src/templates/base.html (2)

25-26: LGTM - New block for head scripts.

The head_js block enables page-specific JavaScript to be loaded in the document head, which is necessary for form widgets like EasyMDE that need to initialize before the DOM is fully loaded. This complements the existing extra_js block at the end of the body.


30-30: LGTM - Consistent breakpoint adjustments.

The breakpoint changes from lg to xl are applied consistently across drawer behavior, navbar visibility, and content padding. This makes the layout more compact on medium-sized screens and provides more content space before the sidebar appears.

Also applies to: 36-36, 57-57

src/templates/media_edit.html (2)

11-20: LGTM - Well-structured asset loading.

The refactored asset inclusion properly separates form media assets across appropriate blocks:

  • extra_css: Form CSS and custom EasyMDE styles
  • head_js: Form JavaScript (EasyMDE needs to initialize early)
  • extra_js: Custom page logic

This is cleaner and more maintainable than inline {{ form.media }} rendering.


236-237: LGTM - Proper block structure.

The closing div and endblock align correctly with the template structure.

src/core/templatetags/media_tags.py (1)

29-29: LGTM - Status badge styling update.

Changing the PAUSED status badge from neutral to primary color makes it more visually distinctive. This is a reasonable UI refinement with no functional impact.

src/templates/partials/media-list.html (1)

6-7: LGTM - Grid breakpoints aligned with layout changes.

The grid breakpoint adjustments align with the responsive layout changes in base.html. The grid now:

  • Maintains 3 columns through large screens
  • Shows 4 columns at xl breakpoint (previously lg)
  • Shows 5 columns at 2xl breakpoint (previously xl)

This provides better spacing and consistency with the updated drawer and navbar breakpoints.

src/templates/partials/media-score-stars.html (1)

1-18: LGTM! Clean refactoring with parameterized sizing.

The size-aware approach with delegation to the inner template is well-structured and maintainable. The conditional logic correctly maps size parameters to DaisyUI rating classes, and the default medium size fallback is appropriate.

src/templates/partials/media-score-stars-inner.html (2)

3-12: LGTM! Accessible star rating implementation.

The implementation correctly:

  • Uses role="img" with localized aria-label for screen reader accessibility
  • Applies DaisyUI's read-only rating pattern with aria-current="true" on stars where forloop.counter <= media.score
  • Leverages DaisyUI's automatic visual fill handling with the bg-orange-400 class

Based on learnings, this pattern is confirmed to work correctly with DaisyUI.


14-16: LGTM! Default badge visibility behavior is clear.

The condition show_badge != False correctly implements the default-visible behavior documented in the parent template, showing the badge unless explicitly set to False.

src/templates/partials/media-items.html (3)

38-41: LGTM! Intentional layout separation for grid view.

The separate rendering of stars (without badge) and badge provides precise layout control, displaying them on separate lines within the card body. This is a valid design pattern for the grid view.


61-76: LGTM! Clean title restructuring with responsive score badge.

The flex container properly aligns the title and year, and the conditional score badge for small screens (md:hidden) provides good mobile UX by showing score information in the title area when the review column is hidden.


80-84: LGTM! Correct responsive score display logic.

The responsive breakpoints are implemented correctly:

  • Below md: Score badge in title section (lines 73-75)
  • md to xl: Badge only in review column (line 83, xl:hidden)
  • xl+: Full stars with badge (line 82, hidden xl:block)

This provides an appropriate progressive enhancement across viewport sizes.

Comment thread src/static/css/easymde.css Outdated
- Reimplement stars in media list.
- Fix EasyMDE dark mode styles.
- Correct media edit template block structure for drawer compatibility with
EasyMDE.
@PascalRepond PascalRepond merged commit d67f49e into main Jan 4, 2026
2 of 3 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.

1 participant