Commit Graph
45 Commits
Author SHA1 Message Date
john-okeefe a075a5061f feat(ui): refresh auth, entry, admin, and secondary pages
Apply the new design-system primitives across the remaining pages so the
whole app shares one visual language:

- Auth/entry: redesigned index, login, register (centered card layout,
  SVG icons, semantic tokens)
- Admin: sidebar nav with icons, cohesive admin dashboard/users/library/
  processing-issues/settings (tables use border-line + hover states;
  scan/websocket attributes preserved)
- Secondary: analytics (stat cards), devices, progress, conflicts, queue,
  profile + form/modal all migrated to .card/.btn/.input primitives and
  SVG action icons
- Docs + API explorer + setup wizard + collection/rules/modals +
  unlinked books + book-detail modals: consistent chrome, modal scrims
  use --surface-overlay, close buttons use icon-btn
- reader.templ and error.templ intentionally left unchanged
2026-08-05 16:01:22 -04:00
john-okeefe 13260d8c1f chore(templates): regenerate all _templ.go files with templ v0.3.1020
Upgrade from templ v0.3.1001 to v0.3.1020. Generated code changes include
JoinStringErrs -> ResolveAttributeValue and removal of manual EscapeString
calls (now handled internally by ResolveAttributeValue).
2026-05-24 21:20:24 -04:00
john-okeefe 0a9cde0fc8 chore(templates): regenerate all _templ.go files
Regenerate all templ-generated Go files. These changes are caused
by running templ generate with a slightly different CLI version
(v0.3.1001) than the go.mod dependency (v0.3.1020), resulting in
minor formatting/import diffs across all templates. No functional
changes.
2026-05-18 17:53:12 -04:00
john-okeefe f23ee6e66a chore(templates): regenerate all templ Go files, add scan spinner to header
Regenerated templ output for all template files. Key source change:
- templates/header.templ: add scan progress spinner SVG and percentage
  display to header nav, initialize scan listener via x-init
2026-05-16 19:31:52 -04:00
john-okeefe 4b43bd04ba chore: regenerate templ files for v0.3.1001
Reverts generated Go template files from templ v0.3.1020 back to
v0.3.1001 output. Changes include filename path prefix adjustments
(admin_library.templ → templates/admin_library.templ) and attribute
handling differences (ResolveAttributeValue → JoinStringErrs + EscapeString).
2026-05-12 16:54:14 -04:00
john-okeefe b829b7fe22 chore: regenerate all templ Go files for v0.3.1020
templ v0.3.1020 generates different code than v0.3.1001 (uses
ResolveAttributeValue for attribute handling). Regenerated all 33
_templ.go files to match the new runtime.
2026-05-10 16:13:53 -04:00
john-okeefe ffaa561cb7 chore: regenerate all templ Go files
Regenerated from .templ sources after template changes. Includes
path reference updates in error messages (templates/ prefix
shortened) from templ tool regeneration.
2026-04-29 20:33:08 -04:00
john-okeefe e87f481988 chore(templates): update FileName references to include templates/ path prefix in generated Go files
All 25 templ-generated Go files had their error-handling FileName fields
updated from bare filenames (e.g. `dashboard.templ`) to path-prefixed
filenames (e.g. `templates/dashboard.templ`). This reflects a change in
how the templ compiler resolves source file paths, likely due to running
generation from the project root instead of within the templates directory.
The change is purely cosmetic and only affects runtime error messages,
not application behavior.

Affected templates:
- Admin: library, processing_issues, settings, sidebar, users
- Reader/Book: book_detail, book_detail_modals, bookshelf
- Collections: collection_modal, collection_rules, collections
- Other pages: conflicts, custom_section, dashboard, devices,
  docs, error, filter_item, header, profile_form, profile_modal,
  progress, queue, unlinked_books
- API: api_explorer
2026-04-25 13:41:20 -04:00
john-okeefe 7cd88b6107 chore(templates): regenerate all templ generated Go files
Regenerated all _templ.go files after running templ generate. Changes
include updated FileName references (relative path normalization) and
line number adjustments from the templ code generator.
2026-04-24 14:03:16 -04:00
john-okeefe af7533529c refactor(templates): remove duplicate main.js script tags, consolidate to header component
Remove redundant <script src="/static/main.js" defer></script> tags from 17+
templates that include the @Header component, eliminating duplicate script
loading that was causing Alpine.js to initialize twice per page load.

The header.templ component now serves as the single source of truth for
main.js inclusion, following the DRY principle and ensuring consistent
script loading across all pages that use the header navigation.

Additionally, add type="button" attribute to all buttons in header navigation
to prevent default form submission behavior when buttons are clicked.

Changes:
- Remove main.js script tag from templates using @Header component
- Keep main.js in header.templ (line 279) as universal inclusion point
- Preserve main.js in special pages: index.templ, login.templ, register.templ
  (these don't use @Header and are standalone entry points)
- Add type="button" to theme toggle, theme selection, wood paneling, and user menu buttons
  to prevent unwanted form submissions or page navigation

Benefits:
- Eliminates Alpine.js double-initialization bug
- Reduces HTTP requests (one script load instead of two)
- Improves maintainability (add header, get scripts automatically)
- Fixes broken @click handlers on collections, devices, and other pages
- Prevents buttons from triggering default form submission behavior

Technical notes:
- Templates affected: admin, analytics, bookshelf, collection_rules,
  collections, conflicts, custom_section, dashboard, devices, docs,
  library, profile, progress, queue, unlinked_books
- No changes to entry pages (index, login, register) which don't use @Header
- HTMX script remains in individual templates (stateless, no double-load issue)
- All interactive buttons in header now explicitly marked type="button" to
  prevent default browser form submission behavior

Related to: previous commit fixing Vite code-splitting
2026-03-13 22:25:12 -04:00
john-okeefe 7068fabbee refactor(docs): remove inline JS from docs template
- Removed ~400 lines of inline JavaScript from docs.templ
- Moved toggleSection function to docs.ts (now uses Alpine )
- Added highlightCurrentPage function to docs.ts
- Added initializeCodeCopyButtons function to docs.ts
- Updated template to use x-init for initialization
- Functions exported for use in Alpine.data
2026-03-13 12:50:51 -04:00
john-okeefe 06461a3202 refactor(alpine): migrate remaining pages to x-init declarative initialization
- Remove DOMContentLoaded event listeners from analytics.ts and docs.ts
- Rely on x-init attribute in templates for page initialization
- Clean up unused exports from collections.ts Alpine data
- Add x-init calls to admin_library, analytics, and docs templates
- Normalize quote style in collections WebSocket script (single to double)
- Disable Add Books button in collection detail (pending implementation)
2026-03-12 18:13:12 -04:00
john-okeefe b4cf1ddafa style: apply code formatting to generated templates and TypeScript files
- Regenerate Go template files with updated FileName paths for error reporting
- Apply Prettier formatting to api-explorer-docs.ts for consistency
- Format long function signatures across multiple lines for readability
- Format long conditional chains for better code clarity

Changes are purely formatting and do not affect functionality:
- api-explorer-docs.ts: Format initAPIExplorerDoc, tryDocEndpoint, and other functions
- Generated _templ.go files: Update FileName paths from relative to absolute (e.g., "admin.templ" → "templates/admin.templ")

This ensures consistent code style across the codebase and improves
error reporting by providing full file paths in template error messages.
2026-03-12 15:44:46 -04:00
john-okeefe 2e65cd7ff5 fix(templates): correct file paths in generated template error reporting
- Update FileName paths in error reporting from relative to absolute paths
- Changes template error paths from 'filename.templ' to 'templates/filename.templ'
- Affects 21 auto-generated Go template files compiled from .templ sources

This fix ensures that template rendering errors provide accurate file locations,
making debugging and error tracking more reliable. The generated files now
correctly reference their source template locations with full path information.

Note: These files are auto-generated by the templ compiler from the .templ
source files committed in the previous commit.
2026-03-12 09:04:26 -04:00
john-okeefe af337c88e2 build: regenerate templ files and compiled CSS
Generated files updated to reflect:
- New admin_settings.templ template
- Updated admin_sidebar.templ with Settings link
- Fixed devices.templ with correct regenerate-token path
- Compiled TailwindCSS with any style changes
2026-03-11 16:42:56 -04:00
john-okeefe 083f152b35 Safety backup before Path A fixes - fixing function mismatches and missing functions 2026-03-11 11:01:43 -04:00
john-okeefe 647644fdce refactor: Consolidate script imports and update Alpine.js syntax in templates
This commit updates all generated template files and the header.templ source
to use consolidated script bundles and modern Alpine.js syntax.

Changes to templates/*.go (generated from .templ source files):
- Replace individual script imports (admin.js, toast.js, header.js, etc.)
  with single /static/main.js bundle
- Convert onclick attributes to Alpine.js @click directives for better
  integration with reactive components
- Add x-data attributes to body elements where needed for Alpine components
- Update event handlers to use Alpine.js syntax consistently

Changes to templates/header.templ source file:
- Add Alpine.js test div with x-data and x-init for debugging
- Reformat theme dropdown and user menu markup with proper indentation
- Maintain consistent Alpine.js directive formatting throughout

This change reduces the number of HTTP requests and ensures consistent
Alpine.js integration across all pages.
2026-03-09 20:58:46 -04:00
john-okeefe c6fa217092 feat: Add library ID support to media scanner and worker
Add default library ID functionality to improve library targeting
during media scans.

Service changes in internal/services/media_scanner.go:
- Add defaultLibraryID field to MediaScanner struct
- Add SetLibraryID() method to set default library
- Modify processMediaFile() to use defaultLibraryID when set
  - Prioritizes defaultLibraryID over folder-based library detection
  - Provides explicit library targeting for scans

Service changes in internal/services/worker.go:
- Add libraryUUID conversion from string to pgtype.UUID
- Call scanner.SetLibraryID() before ScanFolders()
  - Ensures scanner respects the job's library ID

These changes enable more precise library targeting during media scans,
allowing scans to be directed to specific libraries rather than relying
solely on folder-based detection.
2026-03-01 00:29:39 -05:00
john-okeefe b7e0e7ffbb generated: update templ files after admin.templ changes 2026-02-26 10:12:02 -05:00
john-okeefe 4b43116f13 refactor(templates): apply activeClass helper and full-width layout
- Replace inline ternary operators with activeClass helper function
- Change layout containers from max-w-7xl to w-full for full-width design
- Update file path references in error messages for better debugging
2026-02-24 13:41:19 -05:00
john-okeefe e7f30a00c0 style(templates): fix code formatting with consistent indentation
-- Reformat all generated template Go files with consistent indentation
-- Standardize code style across templates/
-- No functional changes, formatting only
-- Generated by templ tool during development
2026-02-23 20:24:10 -05:00
john-okeefe 9ea0ec5a3e feat(templates): consolidate admin and profile templates
Add admin_users.templ for user management interface with delete, password
reset, and edit capabilities. Add profile.templ and related components for
user profile management. Remove admin_profile.templ. Update all templates
to use new consolidated API endpoints.
2026-02-22 01:58:02 -05:00
john-okeefe 0c515a277c refactor(templates): add error toast support to page templates
Update all page templates to accept an optional error message parameter
and display it via the ErrorToast component when data loading fails.
2026-02-20 13:25:49 -05:00
john-okeefe 81c72e706a chore(templates): regenerate template files after templ update
Regenerate all _templ.go files with latest templ generator.
Changes are minimal formatting updates (error message file paths).
2026-02-16 16:51:10 -05:00
john-okeefe d8d84bbca3 Merge branch 'main' of ssh://git.linuxhg.com:2222/Bookhoard/bookhoard 2026-02-03 20:22:41 -05:00
john-okeefe 79373dd225 docs: add sticky header support for documentation pages
- Add CSS rules to web/static/input.css for header positioning
- Header is sticky only on /docs pages via .page-docs body class
- Add page-docs class to body element in templates/docs.templ
- Non-docs pages have static header position
2026-02-03 16:16:14 -05:00
john-okeefe d9c6be1429 docs: rename DEVELOPMENT.md to development.md and update links
- Rename docs/contributing/DEVELOPMENT.md to development.md (lowercase)
- Update all references from DEVELOPMENT.md to Development.md (titlecase links)
- Update docs/contributing/contributing.md
- Update docs/index.md
2026-02-03 13:54:11 -05:00
john-okeefe 3cd378bbee feat: apply Tokyo Night theme to documentation pages
- Add theme-tokyo-night class to docs body tags
- Docs now use CSS variables for all colors (bg, text, accent, border)
- Links now render with correct lighter color (#9aa5ce instead of #565f89)
- Consistent theming across docs and application pages
- Fixes darker link color issue from previous hardcoded values
2026-02-03 09:55:52 -05:00
john-okeefe 4d2069abdb fix: replace Tailwind CDN with local CSS in docs templates
- Remove Tailwind CDN dependency from documentation pages
- Load local /static/style.css instead (includes typography plugin)
- Remove inline tailwind.config script (no longer needed)
- Code blocks now use proper dark colors from input.css overrides
- Consistent with other templates (admin, dashboard, analytics)
- Faster loading (no external CDN request)
- Local build includes all needed CSS (typography + custom overrides)
- Add Zed editor configuration for CSS at-rule warnings
2026-02-03 09:40:02 -05:00
john-okeefe 5630dc6196 fix: remove custom CSS from documentation templates
- Remove <style> tags from DocsLayout and DocsLayoutWithExplorer
- Code block styling now handled by input.css (Tailwind @layer)
- Complies with 'no custom CSS in templates' guideline
- Templates now pure HTML/templ with embedded style removed
- Verification passes: 0 errors, 0 warnings
2026-02-03 09:27:55 -05:00
john-okeefe 1657659de7 revert: remove broken typography config attempts
The Tailwind CDN typography plugin doesn't support the theme function syntax
we were trying to use. The site theming is working correctly with the
custom CSS in place, so we're keeping the working solution.

Code blocks have dark backgrounds (#14151f) and the rest of the site uses
the theme colors from Tailwind config (bg-background-primary, text-text-primary, etc.)
2026-02-02 21:32:53 -05:00
john-okeefe e36320bb2c fix: restore dark code blocks with custom CSS
The Tailwind CDN typography plugin configuration wasn't applying correctly
in the browser. Reverted to using custom CSS with !important flags to ensure
dark code block backgrounds are properly applied.

- Code blocks: #14151f (slightly darker than main background)
- Inline code: #1a1b26 (matches main background)
- Text: #c0caf5 (light text for readability)

This is a pragmatic fix that ensures the documentation remains readable while
we investigate the Tailwind CDN typography plugin issue.
2026-02-02 21:28:16 -05:00
john-okeefe 0fe4a1dacc feat: download documentation dependencies locally for full self-hosting
Replaced CDN dependencies with local downloads for fully self-contained operation:
- Highlight.js (syntax highlighting) - 121KB
- Highlight.js GitHub Dark theme - 1.3KB
- Lunr.js (documentation search) - 29KB
- Lunr-flex (search plugin) - 43KB

Changes:
- Updated package.json postinstall to download all dependencies
- Modified docs templates to use /web/static/ paths
- Updated .gitignore to allow documentation dependencies
- Total added: ~195KB (minimal container impact)

Benefits:
-  Fully self-hosted - no external CDN requests
-  Works offline without internet access
-  No privacy/analytics leaks from CDNs
-  Consistent with project's self-hosting philosophy
-  Improved reliability for air-gapped deployments

Note: Tailwind CSS CDN remains (development-only, production uses compiled CSS)
2026-02-02 21:22:55 -05:00
john-okeefe 121b955334 refactor: use Tailwind typography config instead of custom CSS
Replaced custom <style> blocks with Tailwind Typography plugin configuration
to set dark theme colors for code blocks. This complies with the project
guideline of no custom CSS - all styling now uses Tailwind utilities.

Changes:
- Removed <style> tags from docs templates
- Added typography.extend.invert.css configuration to tailwind.config
- Code blocks now use #14151f background (slightly darker than main #1a1b26)
- Inline code uses theme colors from Tailwind config
- Copy buttons still work with same functionality
2026-02-02 21:16:46 -05:00
john-okeefe 9b58533a81 fix: apply darker code block background color to DocsLayout
Applied the color change (#14151f instead of #1a1b26 for code blocks)
to the DocsLayout function, making code blocks slightly darker than the
main background for better visual distinction.
2026-02-02 21:11:32 -05:00
john-okeefe 26d427c4b3 style: adjust code block background to be subtly darker
Changed code block backgrounds to be slightly darker than the main background:
- Main background: #1a1b26
- Code blocks (pre): #14151f (slightly darker to stand out)
- Inline code: #1a1b26 (matches main background for subtlety)

This creates a subtle distinction that makes code blocks visually
distinct while maintaining the dark theme aesthetic.
2026-02-02 21:07:25 -05:00
john-okeefe 0b979d698e feat: add dark code blocks and copy buttons to documentation
- Fixed white background in code blocks by adding custom CSS
  - Code blocks now use dark background (#1a1b26 for pre, #16161e for code)
  - Inline code matches theme colors
- Added copy buttons to all code blocks
  - Button appears on hover (top-right corner)
  - Shows 'Copy' → 'Copied!' feedback
  - Uses Clipboard API for copying code
- Copy buttons styled to match documentation theme

This improves the dark mode documentation experience with better
code block visibility and usability.
2026-02-02 21:03:39 -05:00
john-okeefe 7d717e32a2 fix: enable Tailwind Typography plugin in docs template
Added ?plugins=typography to Tailwind CDN script to enable prose classes.
This fixes the 'wall of text' issue in documentation by properly styling:
- Headings, paragraphs, lists with proper spacing
- Line-height and typography improvements
- Code blocks, blockquotes, tables, and links

The prose classes now work correctly with the CDN version of Tailwind.
2026-02-02 20:58:48 -05:00
john-okeefe 3babfe520f Regenerate template Go files after CSS-to-Tailwind conversion
Regenerate all _templ.go files using templ generate after
removing custom <style> tags and converting to TailwindCSS.
Line numbers updated in error messages due to template changes.
2026-02-02 10:35:56 -05:00
john-okeefe 2726455578 refactor: convert docs templates to use TailwindCSS
Phase 4+5: Replace custom CSS with Tailwind utility classes
- Remove ~250 lines of custom CSS from docs.templ
- Remove ~120 lines of custom CSS from api_explorer.templ
- Use Tailwind CDN for styling
- Keep only essential CSS:
  * CSS variables for theming (--bg-primary, --accent, etc.)
  * Custom scrollbar styling
  * Mobile sidebar transform transitions
  * Smooth scroll behavior
- All layout, spacing, colors, typography now use Tailwind classes
- Mobile-first responsive design with Tailwind breakpoints
- Proper accessibility with aria-labels and semantic HTML

Benefits:
- Consistent design system
- Smaller custom CSS footprint
- Better maintainability
- Follows PROJECT_GUIDELINES.md requirement: TailwindCSS primary
2026-02-02 09:35:37 -05:00
john-okeefe 542fbaf116 docs: add Lunr.js search with fuzzy matching and highlighting
Phase 4 part 1: Add search infrastructure
- Add SearchDoc struct and GenerateSearchIndex to docs handler
- Add stripHTML helper for plain text extraction
- Add ServeSearchIndex endpoint to http handler
- Add /docs/search-index.json route in main.go
- Search index includes all documentation files with ID, title, content, URL
2026-02-02 09:08:37 -05:00
john-okeefe 3b3630666a docs: integrate API explorer into documentation pages
Phase 3 complete: Add API explorer to endpoint documentation
- Add DocsLayoutWithExplorer template function
- Update HTTPHandler.ShowAPIEndpoint to check authentication
- Add GetAPIEndpointData method to docs handler
- Include API explorer for all endpoint documentation
- Explorer shows mock data to non-authenticated users
- Explorer enables real API execution for logged-in users
- Add legacy fallback for endpoints without explorer data
2026-02-02 08:58:12 -05:00
john-okeefe afdcc7b589 docs: add API explorer template component and fix rendering
Phase 3 part 1: Add interactive API explorer
- Create templates/api_explorer.templ with mock and real modes
- Add EndpointInfo and APIExplorerData types to templates/types.go
- Fix markdown rendering with UnsafeHTML.ToComponent()
- Add templ import for Component support
- API explorer supports:
  - Mock data mode for non-authenticated users
  - Real execution mode for logged-in users
  - Request/response display
  - cURL generation
  - Copy to clipboard
2026-02-02 08:56:23 -05:00
john-okeefe 1e8cfa1008 Phase 1: Fix markdown rendering
- Add rawHTML helper function using template.HTML()
- Update docs template to use { template.HTML(doc.Content) }
- Docs now render HTML headings and content properly
- Markdown is converted to HTML by goldmark (with Unsafe()) and output directly
2026-02-01 21:05:12 -05:00
john-okeefe 5c7137feb8 docs: add interactive documentation system with Go+HTMX
- Add internal/docs package with markdown renderer (goldmark)
- Create docs layout template with sidebar navigation
- Implement hierarchical navigation auto-generated from docs folder
- Add table of contents generator (extract ## headings)
- Add syntax highlighting for code blocks (highlight.js)
- Add mobile responsive design
- Add /docs routes to main.go

The documentation system features:
- Dark theme matching app design
- Collapsible sidebar sections (Getting Started, User Guide, Device Setup, API Reference, Contributing)
- Table of contents for each page
- Breadcrumb navigation
- Full-text search (client-side JavaScript, API endpoint ready)
- Syntax highlighting for code blocks
- Mobile-friendly with hamburger menu

All documentation is served from /docs route, no authentication required.
Markdown files are rendered using goldmark with GFM extensions and syntax highlighting.
2026-02-01 18:33:55 -05:00