Skip to content

spec: align FEATURE_ROW_ACTIONS.md with implementation#11

Open
javier-godoy wants to merge 8 commits into
spec/row-actionsfrom
spec/row-actions-update-1
Open

spec: align FEATURE_ROW_ACTIONS.md with implementation#11
javier-godoy wants to merge 8 commits into
spec/row-actionsfrom
spec/row-actions-update-1

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented May 26, 2026

Summary

  • Drop with prefix from EasyRowAction fluent setters (visibleWhen, enabledWhen, tooltip): the with prefix is a builder-pattern convention for separate builder objects. EasyRowAction is the domain object itself; Vaadin's component-style convention uses bare verb names for self-returning configurators.

  • Remove addRowAction(..., ButtonVariant, ...) overload: a single ButtonVariant slot cannot express multiple variants and cannot set arbitrary theme strings. The right shape for theme-variant support is a dedicated addThemeVariants(ButtonVariant...) method on EasyRowAction, not a factory-method parameter.

  • Expand addRowAction overload set: accepting AbstractIcon<ICON> and ValueProvider<T,ICON> is more general than VaadinIcon alone — it covers Lumo icons, custom SVGs, and any icon library. Label-only and icon-only overloads reduce boilerplate for the common cases. VaadinIcon implements IconFactory, so existing call sites are unaffected.

  • Replace SerializableFunction with ValueProvider for the dynamic tooltip: ValueProvider<T,V> is the idiomatic Vaadin type for "given a bean, produce a value". It is consistent with the per-row icon overloads and signals intent more clearly than the generic SerializableFunction. Both are @FunctionalInterface, so no call-site changes are required.

  • Add removeRowAction / EasyRowAction.remove(): row-action removal is a basic lifecycle operation needed whenever actions are registered conditionally. Two entry points are provided because callers may hold a reference to the grid, to the action, or to both.

Summary by CodeRabbit

  • Documentation
    • Updated Row Actions API documentation with expanded icon support options (label-only, icon-only, label+icon).
    • Documented dynamic, per-row icons and conditional visibility/enablement configuration.
    • Enhanced tooltip API with static and dynamic options.
    • Documented action removal capabilities and menu-based overflow configuration.

Review Change Stack

Rename withVisibleWhen→visibleWhen, withEnabledWhen→enabledWhen,
withTooltip→tooltip in spec and usage examples to match the
implementation and Vaadin's component-style naming convention.
The four-parameter overload was never implemented. Remove it from the
spec and update the usage example to match the actual API.
Replace the single VaadinIcon overload with the full set implemented:
label-only, Icon, IconFactory, icon-only, and per-row ValueProvider
variants. Update usage examples accordingly.
Replace SerializableFunction<T,String> with ValueProvider<T,String>,
the idiomatic Vaadin type for per-row value providers.
Document the removal API that exists in the implementation but was
absent from the spec. Add usage example showing both call sites.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9fbc924d-1781-4458-a7cb-5f02f6a2b738

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

FEATURE_ROW_ACTIONS.md documents an updated Row Actions API for EasyGrid<T>. Multiple addRowAction overloads support label-only, icon-only, label+icon, and dynamic per-row icons via ValueProvider. EasyRowAction<T> fluent configuration methods handle visibility, enablement, tooltips, and confirmations. Removal occurs via grid-level or action-level methods.

Changes

Row Actions API Documentation

Layer / File(s) Summary
EasyGrid Row Actions API definition
FEATURE_ROW_ACTIONS.md
EasyGrid<T> documents expanded addRowAction overloads: label-only, label+icon via Icon/IconFactory, icon-only, and per-row dynamic icons via ValueProvider. removeRowAction(EasyRowAction<T>) removal API added.
EasyRowAction fluent configuration
FEATURE_ROW_ACTIONS.md
EasyRowAction<T> fluent methods documented: visibleWhen and enabledWhen for conditions, tooltip with String and ValueProvider overloads, withConfirmation for dialogs, and remove() for grid deregistration.
Usage and removal examples
FEATURE_ROW_ACTIONS.md
Usage examples demonstrate dynamic icon provisioning, visibleWhen conditional visibility, menu overflow configuration, and dual removal pathways: easyGrid.removeRowAction(actionRef) and actionRef.remove().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 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 'spec: align FEATURE_ROW_ACTIONS.md with implementation' clearly and concisely summarizes the main change: updating documentation to match the current API implementation, with specific focus on the Row Actions feature.
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 spec/row-actions-update-1

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.

@javier-godoy javier-godoy marked this pull request as draft May 26, 2026 19:46
@javier-godoy javier-godoy marked this pull request as ready for review May 26, 2026 19:46
@paodb
Copy link
Copy Markdown
Member

paodb commented May 26, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread FEATURE_ROW_ACTIONS.md
// Removing an action
EasyRowAction<T> adminAction = easyGrid.addRowAction("Purge", VaadinIcon.TRASH, item -> purge(item));
// later:
easyGrid.removeRowAction(adminAction);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

removeRowAction and EasyRowAction.remove() are introduced, but the spec doesn't pin down their behavior at the edges. Maybe is worth specifying things like:

  • Calling remove() twice (or removeRowAction(a) after a.remove()): no-op or IllegalStateException?
  • Whether the EasyRowAction reference is still usable after removal (can it be re-added, or is its state considered dead?)
  • When the removal becomes visible: immediate re-render or next data refresh?

What do you think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added some clarification on the behaviors

@github-project-automation github-project-automation Bot moved this from To Do to In Progress in Flowing Code Addons May 26, 2026
@javier-godoy
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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 `@FEATURE_ROW_ACTIONS.md`:
- Line 96: The example uses a generic type parameter T without defining it;
change the declaration to use the concrete type used by the grid (e.g.
EasyRowAction<Person> adminAction) so it matches the grid's type parameter used
elsewhere (easyGrid) and the lambda purge(item) signature; update the
EasyRowAction instantiation to EasyRowAction<Person> and ensure the item
parameter type aligns with the purge(Person) method.
🪄 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: 5c63cfbd-213d-4fb6-80b9-79414a7c8f3f

📥 Commits

Reviewing files that changed from the base of the PR and between de3c379 and 94c028c.

📒 Files selected for processing (1)
  • FEATURE_ROW_ACTIONS.md

Comment thread FEATURE_ROW_ACTIONS.md Outdated
@javier-godoy javier-godoy requested a review from paodb May 27, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants