feat: add action align & columnWidth for actions#127
Conversation
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
📝 WalkthroughWalkthroughAdds an optional ChangesColumn Alignment and Width Configuration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@projects/ngx/declarative-ui/table-card/declarative-table-card.component.ts`:
- Around line 237-239: The hardcoded columnWidth: '90px' in the edit-action
config causes text buttons to be truncated; update the code that constructs the
edit action config (the object with keys columnWidth, displayAs, align) to only
set columnWidth when needed (e.g., for icon/buttons) or set it to 'auto' /
undefined for text actions—use displayAs to decide: if displayAs === 'text' omit
columnWidth (or set 'auto'), otherwise keep the fixed width; adjust the
action-building logic so columnWidth is conditional based on displayAs.
In
`@projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.html`:
- Around line 33-63: The grouped fields wrapper currently forces a horizontal
layout via the hardcoded class "flex", breaking column.group.multiline; update
the wrapper (the div with class "flex" that binds [style.justifyContent]) to
only apply the flex display when column.group.multiline is false (e.g. change to
a conditional class or binding such as [class.flex]="!column.group.multiline" or
set display style conditionally), so when column.group.multiline is true the
fields render stacked on separate lines while preserving the existing logic for
rendering fields (column.group.fields, columnTrackBy) and delimiters.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 62ebfb5e-dd93-476e-a189-940fd4b2cf16
📒 Files selected for processing (6)
docs/declarative-table.mdprojects/ngx/declarative-ui/models/ui-definition.tsprojects/ngx/declarative-ui/stories/declarative-table-card.stories.tsprojects/ngx/declarative-ui/table-card/declarative-table-card.component.tsprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.htmlprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.scss
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
There was a problem hiding this comment.
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 `@projects/ngx/declarative-ui/stories/declarative-table-card.stories.ts`:
- Around line 437-439: The first field in the "actions" grouped column for the
DeclarativeTableCard story is missing alignment and causing the whole actions
group to render left-aligned; update the story's actions group definition by
adding align: 'end' to the first field of that actions group (the same field
block that currently contains uiSettings: { columnWidth: '90px' }) so the
grouped-column alignment is right-aligned consistently.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0acf885f-3f7e-48e8-ac2f-93c199b0e476
📒 Files selected for processing (7)
docs/declarative-table-card.mdprojects/ngx/declarative-ui/stories/declarative-table-card.stories.tsprojects/ngx/declarative-ui/stories/declarative-table.stories.tsprojects/ngx/declarative-ui/table-card/declarative-table-card.component.tsprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.htmlprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.scssprojects/ngx/declarative-ui/table/declarative-table/declarative-table.component.spec.ts
✅ Files skipped from review due to trivial changes (1)
- docs/declarative-table-card.md
🚧 Files skipped from review as they are similar to previous changes (1)
- projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.html
What changed
Actions column is now right-aligned Edit and delete
buttons are grouped under
group.name: 'actions'contentalignment is controlled via
uiSettings.align: 'end', which maps tojustify-content: flex-endon the cell's flex wrapper.First-field rule for group columns. When multiple
TableFieldDefinitionentries share the same
group.name, the first field in the array is theprimary field — its
uiSettings.columnWidthanduiSettings.alignset thecolumn-level configuration. Subsequent fields in the group inherit this
layout; their own
columnWidth/alignvalues are ignored. This means customaction buttons placed before the built-in edit/delete actions will naturally
own the column width.
UI5 column width constraint documented.
uiSettings.columnWidthmust bea valid CSS
<length>(px,rem,em,%,calc()). Sizing keywordslike
min-contentandmax-contentare silently rejected by UI5's internalvalidation and cause the column to fall back to equal-stretch distribution.
The
declarative-tabledocs now call this out explicitly.uiSettings.align('start' | 'center' | 'end') is a new property onUiSettings. It works for both standalone columns and group columns (drivenby the first field).
Summary by CodeRabbit
New Features
Documentation