Skip to content

fix: use daisyUI-themed pagination#277

Merged
David-Crty merged 2 commits intomainfrom
fix/pagination-daisy-ui-theme
May 6, 2026
Merged

fix: use daisyUI-themed pagination#277
David-Crty merged 2 commits intomainfrom
fix/pagination-daisy-ui-theme

Conversation

@David-Crty
Copy link
Copy Markdown
Owner

@David-Crty David-Crty commented May 6, 2026

Summary

  • Published and customized Livewire's Tailwind pagination view to use daisyUI's join/btn components instead of hardcoded Tailwind colors, so pagination respects the active theme
  • Fixed a scrollbar flash during Livewire DOM morphing caused by Mary UI's overflow-y-auto on the pagination wrapper

Test plan

  • All 898 tests pass
  • Verify pagination buttons match the active daisyUI theme
  • Click through pagination pages and confirm no scrollbar flash
  • Test on mobile viewport to verify responsive pagination still works

Summary by CodeRabbit

  • Bug Fixes

    • Fixed scrollbar flash in pagination so paging content displays smoothly.
  • New Features

    • Added a responsive pagination interface with optimized mobile and desktop layouts and automatic scroll-into-view when navigating pages.
    • Improved accessibility for pagination controls.
  • Localization

    • Added Spanish and French translations for pagination UI strings (labels, navigation prompts, and count phrasing).

The default Livewire pagination view uses hardcoded Tailwind colors
that don't respect the active daisyUI theme. Published and customized
the pagination view to use daisyUI's join/btn components, and fixed
a scrollbar flash caused by Mary UI's overflow-y-auto on the
pagination wrapper.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43f9c880-f157-430a-8dcc-b4155071ff05

📥 Commits

Reviewing files that changed from the base of the PR and between c699fd0 and 0d17aff.

📒 Files selected for processing (2)
  • lang/es.json
  • lang/fr.json
✅ Files skipped from review due to trivial changes (1)
  • lang/fr.json
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci
🔇 Additional comments (1)
lang/es.json (1)

669-675: LGTM — translations are linguistically accurate and match Livewire's pagination key contracts.

All seven new entries use the correct Laravel pluralization syntax, proper gender agreement (el último … día / los últimos … días), and idiomatic Spanish for each pagination phrase. The generic single-word keys ("of", "to") have no pre-existing collision in this file.


📝 Walkthrough

Walkthrough

Adds a new Livewire Tailwind pagination view with scroll-into-view behavior and responsive mobile/desktop controls, a CSS rule to prevent a Mary UI pagination scrollbar flash, and new Spanish and French translation entries for pagination strings.

Changes

Livewire Pagination + Styling + Translations

Layer / File(s) Summary
Scroll behavior / JS snippet
resources/views/vendor/livewire/tailwind.blade.php
Introduces a PHP block that computes a default scroll target and a JS snippet to scroll that target into view when the page changes.
Pagination View (mobile)
resources/views/vendor/livewire/tailwind.blade.php
Adds mobile pagination controls with previous/next buttons, disabled states, and Livewire actions.
Pagination View (desktop)
resources/views/vendor/livewire/tailwind.blade.php
Adds desktop layout showing "Showing X to Y of Z results", page links, three-dots separators, and accessible aria-labels; wires page links to Livewire actions.
Styling fix
resources/css/app.css
Adds CSS rule forcing overflow-y: visible on the last child div of .mary-table-pagination to prevent scrollbar flashing.
Translations
lang/es.json, lang/fr.json
Adds seven pagination-related translation entries (including pluralization for last day(s), "Go to page :page", "of", "Pagination Navigation", "results", "Showing", and "to").

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant LivewireJS
    participant Server
    participant DOM

    User->>Browser: Clicks page link / next
    Browser->>LivewireJS: emits Livewire action (page change)
    LivewireJS->>Server: AJAX request for new page
    Server-->>LivewireJS: responds with updated view/html
    LivewireJS->>DOM: Replaces pagination/content HTML
    LivewireJS->>DOM: Evaluates scroll-to-view JS snippet
    DOM-->>Browser: Scrolls target element into view
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I hop on pages, soft and spry,
New links that blink, a gentle sigh.
No jarring bars to break the beat,
Smooth scroll and text all lined and neat.
Bravo — I nibble carrots, sweet.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: use daisyUI-themed pagination' accurately summarizes the main change: implementing daisyUI-themed pagination components instead of hardcoded Tailwind classes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pagination-daisy-ui-theme

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.32%. Comparing base (3fbb31d) to head (0d17aff).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #277   +/-   ##
=========================================
  Coverage     91.32%   91.32%           
  Complexity     2179     2179           
=========================================
  Files           192      192           
  Lines          7818     7818           
=========================================
  Hits           7140     7140           
  Misses          678      678           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@resources/views/vendor/livewire/tailwind.blade.php`:
- Around line 37-44: The pagination template
resources/views/vendor/livewire/tailwind.blade.php introduced new translation
keys ('Showing', 'to', 'of', 'results', 'Pagination Navigation', 'Go to page
:page'); add these keys with appropriate Spanish and French translations into
each locale JSON (lang/{locale}.json), ensure the 'Go to page :page' string
preserves the :page placeholder exactly, and include 'Pagination Navigation' and
the other four single-word keys so the trans() calls used in the blade file
resolve to localized text instead of falling back to the English keys.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b768835f-a484-4328-b9cf-2239024938df

📥 Commits

Reviewing files that changed from the base of the PR and between 3fbb31d and c699fd0.

📒 Files selected for processing (2)
  • resources/css/app.css
  • resources/views/vendor/livewire/tailwind.blade.php
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci
🧰 Additional context used
📓 Path-based instructions (3)
**/*.php

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.php: In PHP files, always use curly braces for control structures, even for single-line bodies.
Use PHP 8 constructor property promotion: public function __construct(public GitHub $github) { }. Do not leave empty zero-parameter __construct() methods unless the constructor is private.
Use explicit return type declarations and type hints for all method parameters in PHP: function isAccessible(User $user, ?string $path = null): bool
Prefer PHPDoc blocks over inline comments. Only add inline comments for exceptionally complex logic.
Use array shape type definitions in PHPDoc blocks for PHP.

Files:

  • resources/views/vendor/livewire/tailwind.blade.php
resources/views/**/*.blade.php

📄 CodeRabbit inference engine (CLAUDE.md)

resources/views/**/*.blade.php: All UI components in Mary UI should be prefixed with x- (e.g., <x-button>, <x-input>, <x-card>) and use Heroicons for icons (e.g., icon="o-user" for outline, icon="s-user" for solid).
In Mary UI select components, use the :options prop with array format [['id' => 'value', 'name' => 'Label']].
In Mary UI alerts, use class="alert-success", class="alert-error", etc. (not variant prop).
Use Alpine.js for client-side interactions in Livewire instead of JavaScript frameworks.
In Blade templates, use :attr binding (dynamic syntax) instead of {{ }} interpolation when passing translated strings to component attributes to avoid double-encoding special characters.

Files:

  • resources/views/vendor/livewire/tailwind.blade.php
**/*.{php,blade.php}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{php,blade.php}: Always use named routes and the route() function when generating links to other pages.
Translations should use __('...') helper function and be stored in JSON translation files in lang/{locale}.json. Keep technical terms like 'Backup', 'Restore', 'Snapshot(s)' in English across all locales.

Files:

  • resources/views/vendor/livewire/tailwind.blade.php
🧠 Learnings (4)
📚 Learning: 2026-03-31T09:50:07.123Z
Learnt from: David-Crty
Repo: David-Crty/databasement PR: 199
File: resources/css/adminer.css:2-2
Timestamp: 2026-03-31T09:50:07.123Z
Learning: In this Vite-based setup, relative CSS `import` paths inside `resources/css/**/*.css` (e.g., `import '../../vendor/.../adminer.css'`) should be treated as build-time-resolved by `npm run build` and are expected to be inlined into the generated `public/build/assets/adminer-*.css`. If the path resolves correctly under `npm run build`, do not flag the `import` as broken during code review—even though Vite dev-server resolution may differ and is not used for production in this project.

Applied to files:

  • resources/css/app.css
📚 Learning: 2026-01-30T22:27:46.107Z
Learnt from: David-Crty
Repo: David-Crty/databasement PR: 61
File: resources/views/livewire/volume/connectors/s3-config.blade.php:1-13
Timestamp: 2026-01-30T22:27:46.107Z
Learning: In Blade template files (any .blade.php) within the databasement project, allow using alert-info for informational content inside <x-alert> components. The guideline that permits alert-success and alert-error does not exclude using alert-info for informational purposes. Apply this consistently to all Blade components that render alerts; ensure semantic usage and accessibility.

Applied to files:

  • resources/views/vendor/livewire/tailwind.blade.php
📚 Learning: 2026-02-06T10:34:43.585Z
Learnt from: David-Crty
Repo: David-Crty/databasement PR: 75
File: resources/views/livewire/backup-job/_filters.blade.php:36-40
Timestamp: 2026-02-06T10:34:43.585Z
Learning: In Blade template files, when creating compact inline filter controls, prefer using native <input type="checkbox"> elements with daisyUI classes (e.g., checkbox checkbox-warning checkbox-xs) over the Mary UI <x-checkbox> component. The <x-checkbox> component adds wrapper markup (e.g., <div><fieldset><label> with gap-3) that can break tight inline flex layouts. Use the native input approach for compact inline controls, but reserve <x-checkbox> for form fields that require labels, hints, and errors.

Applied to files:

  • resources/views/vendor/livewire/tailwind.blade.php
📚 Learning: 2026-02-25T10:48:17.811Z
Learnt from: David-Crty
Repo: David-Crty/databasement PR: 132
File: app/Console/Commands/RecoverAgentLeasesCommand.php:44-48
Timestamp: 2026-02-25T10:48:17.811Z
Learning: When reviewing PHP code, especially with foreign keys that use cascadeOnDelete and are non-nullable, assume child relations exist at runtime (the database will delete children when the parent is deleted). Do not rely on null-safe operators for these relations, as PHPStan already models them as non-null. This guideline applies broadly to PHP files that define models with foreign keys using cascade delete; verify there are no unnecessary null checks or optional chaining on such relations.

Applied to files:

  • resources/views/vendor/livewire/tailwind.blade.php
🔇 Additional comments (3)
resources/css/app.css (1)

22-26: LGTM – targeted fix for the scrollbar flash.

The selector specificity and layer ordering are both correct; the custom rule reliably overrides Mary UI's overflow-y-auto utility without unintended side-effects.

resources/views/vendor/livewire/tailwind.blade.php (2)

1-11: LGTM – \$el escape and $scrollTo interpolation are both correct.

The heredoc correctly uses \$el so PHP does not interpolate it, leaving the Alpine.js magic property $el intact in the emitted attribute. {$scrollTo} is the intended PHP interpolation for the developer-supplied CSS selector.


13-106: LGTM – daisyUI components and accessibility are correctly applied.

The join + btn/btn-active/btn-disabled pattern correctly delegates theming to daisyUI, aria-current="page" and aria-label attributes are properly placed, and wire:key on each page item ensures stable Livewire DOM morphing.

Comment thread resources/views/vendor/livewire/tailwind.blade.php
@David-Crty David-Crty merged commit fa11ff8 into main May 6, 2026
4 checks passed
@David-Crty David-Crty deleted the fix/pagination-daisy-ui-theme branch May 6, 2026 12:55
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