Skip to content

feat(datatables): add tooltip support and custom button helper#112

Merged
sebastienheyd merged 4 commits intomasterfrom
feat/button-tooltip-custom
Feb 14, 2026
Merged

feat(datatables): add tooltip support and custom button helper#112
sebastienheyd merged 4 commits intomasterfrom
feat/button-tooltip-custom

Conversation

@sebastienheyd
Copy link
Owner

Summary

Add tooltip support and custom button helper to DataTable buttons with comprehensive improvements.

Features

  • ✅ Add tooltip functionality with conditional rendering (no empty title="")
  • ✅ Introduce custom() static helper method for simplified button creation
  • ✅ Smart parameter ordering: icon before tooltip for better ergonomics
  • ✅ Intelligent empty icon handling to prevent unnecessary HTML generation
  • ✅ Comprehensive test coverage (8 tests, 20 assertions)
  • ✅ Complete documentation with examples

API Usage

Method 1: Fluent API

Button::add('My button')
    ->route('users.show', $user->id)
    ->tooltip('View details')
    ->icon('eye')
    ->color('primary')
    ->make();

Method 2: Custom helper

Button::custom(
    'users.edit',           // route
    $user->id,              // args
    'pencil-alt',           // icon (3rd parameter)
    'Edit user profile',    // tooltip (4th parameter)
    'warning',              // color
    ['data-action' => 'edit'] // attributes
);

Test Results

✅ All 228 tests pass with 735 assertions

Changes

  • src/Datatables/Button.php: Add tooltip property, custom() and tooltip() methods, conditional rendering
  • tests/Datatables/ButtonTest.php: Complete test suite
  • docs/docs/8.x/datatables/button.md: Updated documentation

Closes #104

Add tooltip functionality to datatable buttons with conditional rendering to avoid empty title attributes. Introduce custom() static helper method for simplified button creation with icon, tooltip, color and attributes support. The method intelligently handles empty icons to prevent unnecessary HTML generation.

Include comprehensive test suite with 8 tests covering tooltip rendering, method chaining, custom button creation with various parameter combinations, and argument order validation.

Also update documentation with detailed examples and usage instructions.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 207efd620b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

sebastienheyd and others added 3 commits February 14, 2026 17:37
Group the tooltip setter with other setters (color, class, link, etc.)
before the make() rendering method for better readability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sebastienheyd
Copy link
Owner Author

@codex review

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sebastienheyd sebastienheyd merged commit 951515a into master Feb 14, 2026
4 of 5 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