Skip to content

feat: add tooltips to auto-attached export icons #200

Open
paodb wants to merge 2 commits into
masterfrom
issue-114
Open

feat: add tooltips to auto-attached export icons #200
paodb wants to merge 2 commits into
masterfrom
issue-114

Conversation

@paodb
Copy link
Copy Markdown
Member

@paodb paodb commented May 21, 2026

Close #114.

  • Adds default tooltips (Export to Excel/Word/PDF/CSV) to the four auto-attached export icons rendered by GridExporter.createFor.
  • Exposes set*ExportTooltipText(String) for simple overrides. Pass null to opt out of a specific tooltip entirely.
  • Exposes set*ExportTooltipConfigurator(SerializableConsumer<Tooltip>) for advanced customization (position, opening delay, etc.); receives the live Vaadin Tooltip instance at attach time.
  • Demo updated in GridExporterDemo to showcase both the text override (Excel) and the configurator (CSV → TooltipPosition.TOP).
  • Version updated to 3.1.0-SNAPSHOT

Summary by CodeRabbit

  • New Features

    • Added customizable tooltips for Excel, Word (DOCX), PDF, and CSV export buttons, including configurable text and appearance.
  • Chores

    • Updated project version to 3.1.0-SNAPSHOT.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Walkthrough

The PR adds per-export tooltip support to GridExporter, allowing users to configure tooltip text and behavior for Excel, DOCX, PDF, and CSV export buttons. Public setter methods enable customization before grid attachment, applied via a shared helper during grid setup. The version bumps to 3.1.0-SNAPSHOT.

Changes

Export Tooltip Configuration Feature

Layer / File(s) Summary
Tooltip API and Core Implementation
src/main/java/com/flowingcode/vaadin/addons/gridexporter/GridExporter.java
Introduces Tooltip import, internal fields to store per-export tooltip text and configurators, a private helper method to conditionally create and configure Tooltip instances, and public setter methods for each export type (text and configurator variants).
Tooltip Application During Grid Attachment
src/main/java/com/flowingcode/vaadin/addons/gridexporter/GridExporter.java
During grid attachment in createFor(), applies stored tooltip text and configurators to each export button (Excel, DOCX, PDF, CSV) via the shared applyExportTooltip helper method.
Demo and Test Usage
src/test/java/com/flowingcode/vaadin/addons/gridexporter/GridExporterDemo.java
GridExporterDemo imports Tooltip and demonstrates the API by setting Excel export tooltip text, configuring the CSV tooltip position to TOP via a configurator, and disabling the PDF export tooltip by setting its text to null.
Version Bump
pom.xml
Project version incremented from 3.0.1-SNAPSHOT to 3.1.0-SNAPSHOT.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • mlopezFC
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title 'feat: add tooltips to auto-attached export icons' clearly and concisely summarizes the main change: adding tooltip functionality to export icons.
Linked Issues check ✅ Passed The PR fully implements the coding requirements from #114: it assigns default tooltips to export icons and provides public API methods (setExportTooltipText and setExportTooltipConfigurator) for users to override defaults.
Out of Scope Changes check ✅ Passed All changes are scope-appropriate: tooltip implementation for export icons directly fulfills #114 requirements, version bump is standard practice for feature releases, and demo updates showcase the new functionality.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-114

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.

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 `@src/main/java/com/flowingcode/vaadin/addons/gridexporter/GridExporter.java`:
- Around line 236-247: applyExportTooltip currently creates a Tooltip whenever a
configurator is provided, which prevents honoring null as "disable tooltip";
change applyExportTooltip so that if text is null it does not create or modify a
Tooltip even when a configurator is non-null — i.e., short-circuit before
calling Tooltip.forComponent(component) when text == null (unless you intend
null to only disable default text, in which case update docs instead); locate
applyExportTooltip, remove or bypass the Tooltip.forComponent(...) and
configurator.accept(...) calls when text is null, ensuring tooltip.setText(text)
and configurator.accept(tooltip) only run on a non-null text (or adjust docs if
you prefer the other behavior).
🪄 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: 5af98e59-8e2b-4be8-9b9a-dea50ef4bce8

📥 Commits

Reviewing files that changed from the base of the PR and between 34f85d0 and b38c207.

📒 Files selected for processing (3)
  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/gridexporter/GridExporter.java
  • src/test/java/com/flowingcode/vaadin/addons/gridexporter/GridExporterDemo.java

@sonarqubecloud
Copy link
Copy Markdown

@paodb
Copy link
Copy Markdown
Member Author

paodb commented May 21, 2026

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

✅ Actions performed

Full review triggered.

@paodb paodb marked this pull request as ready for review May 21, 2026 20:50
@paodb paodb requested review from javier-godoy and scardanzan May 21, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

Set tooltips to export icons

1 participant