fix: back button is a history.back() in media detail and edit#41
fix: back button is a history.back() in media detail and edit#41PascalRepond merged 1 commit intomainfrom
Conversation
📝 WalkthroughWalkthroughReplaces breadcrumb/back-link header with a single back button (uses history.back() with a home-URL fallback) in two templates; simplifies back-icon markup; moves title placement in the header; changes review content wrapper class from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Fix all issues with AI Agents 🤖
In @src/templates/media_detail.html:
- Line 19: The button element that calls history.back() (the button rendering {%
translate "My media" %}) is missing an explicit type and may default to submit;
add type="button" to that button (same pattern as the earlier buttons at lines
13-15) so it won't submit the form when clicked.
- Around line 13-15: The Back button element (the button with
onclick="history.back()" and aria-label translating "Back to list") lacks an
explicit type and thus defaults to type="submit"; update that button to include
type="button" (matching the implementation in media_edit.html) to prevent
accidental form submission and ensure consistent behavior.
In @src/templates/media_edit.html:
- Around line 29-32: The back button uses history.back() directly which leaves
users stranded if history.length <= 1; update the onclick behavior (both
occurrences) to check history.length and redirect to a safe default route when
there's no history, or move the logic into a helper (e.g., a new function in
media_edit.js like handleBack()) and call that from the button so it
consistently does "if history.length > 1 then history.back() else
window.location.href = '/path/to/media-list/'".
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/templates/media_detail.htmlsrc/templates/media_edit.html
🧰 Additional context used
🧠 Learnings (3)
📚 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_detail.htmlsrc/templates/media_edit.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_detail.htmlsrc/templates/media_edit.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_detail.htmlsrc/templates/media_edit.html
🔇 Additional comments (1)
src/templates/media_detail.html (1)
106-106: Thereview-textclass provides comprehensive styling for rendered markdown content, including proper typography for headings, lists, code blocks, blockquotes, and links. The styling is already well-established across multiple templates and uses DaisyUI/Tailwind utilities for theme consistency.
No description provided.