Skip to content

Add reusable template components with dict helper#79

Draft
retlehs wants to merge 4 commits intomainfrom
reuseable-components
Draft

Add reusable template components with dict helper#79
retlehs wants to merge 4 commits intomainfrom
reuseable-components

Conversation

@retlehs
Copy link
Copy Markdown
Member

@retlehs retlehs commented Mar 29, 2026

Summary

  • Add components.html with reusable Go template components: shell-command, notice, input, pagination
  • Add dict and trustedHTML template functions, and buildPagination() helper for pre-computing pagination URLs
  • Replace ~110 lines of duplicated HTML across docs, compare, detail, index, and untagged templates
  • Standardize untagged page form controls to h-10 with / keyboard shortcut indicator

Test plan

  • Verify shell command blocks render and copy-to-clipboard works on docs, compare, detail, untagged pages
  • Verify warning notice renders on index and docs pages
  • Verify search input with / shortcut works on both index and untagged pages
  • Verify author input with autocomplete/clear button still works on untagged page
  • Verify pagination works on index (with filters/search) and untagged (with filters/author/sort)
  • Verify amber variant shell command renders correctly on detail page for trunk-only packages

🤖 Generated with Claude Code

Add components.html with shell-command, notice, input, and pagination
components. Add dict and trustedHTML template functions, and
buildPagination() for pre-computing pagination URLs. Replace duplicated
HTML across docs, compare, detail, index, and untagged templates.
Standardize untagged page form controls to h-10 with / shortcut.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs self-assigned this Mar 29, 2026
retlehs and others added 3 commits March 29, 2026 00:02
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pre-render the stats content in the handler so the notice component
can be used instead of inline HTML.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split notice into notice-open (outputs wrapper + icon) and notice
(adds Content span). Complex content like the detail page untagged
warning uses notice-open directly with inline template content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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