Skip to content

Tags display#146

Merged
Sobyt483 merged 5 commits into
mainfrom
tags-display
May 25, 2026
Merged

Tags display#146
Sobyt483 merged 5 commits into
mainfrom
tags-display

Conversation

@Sobyt483
Copy link
Copy Markdown
Contributor

@Sobyt483 Sobyt483 commented May 25, 2026

What changed

New tag display mode in ValueCell

Added displayAs: 'tag' as a new cell rendering option. When set, the cell renders each value as a <ui5-tag> chip instead of plain text.

  • String values are split by a configurable separator (default ',')
  • Array values are rendered directly — each element becomes a chip
  • Empty segments are filtered out automatically
  • Behavior is controlled via a new tagSettings config: design, colorScheme, separator

New TagListValue component

Introduced TagListValue (mfp-tag-list-value) — a standalone component that wraps an array of strings into a wrapping flex container of <ui5-tag> chips. Exported from the public API alongside BooleanValue, LinkValue, and SecretValue.

New TagSettings interface

Added TagSettings to the model:

interface TagSettings {
  design?:      'Neutral' | 'Positive' | 'Critical' | 'Negative' | 'Information' | 'Set1' | 'Set2';
  colorScheme?:   '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' //default '1'
  separator?:   string; // default ','
}

Removal of labelDisplay

UiSettings.labelDisplay and the associated .label-value CSS (blue pill badge) have been removed. Existing usages in stories and config are migrated to displayAs: 'tag'.

Change Log

  • 🔥 (breaking) UiSettings.labelDisplay removed — replace with uiSettings: { displayAs: 'tag' }
  • Added displayAs: 'tag' cell rendering mode with <ui5-tag> chip output
  • Added TagSettings interface (design, colorScheme, separator)
  • Added TagListValue standalone component, exported from public API
  • Updated GroupedWithLabelsAndAlert story to GroupedWithTagsAndAlert
  • Added Tags Storybook story demonstrating comma-separated, pipe-separated, and array inputs
  • Fixed attribute ordering lint errors in declarative-table.component.html and declarative-table-card.component.html

Summary by CodeRabbit

Release Notes

  • New Features

    • Added tag display mode for cell values, rendering values as styled chip components with customizable separators and styling options
    • Supports both string and array inputs for flexible data handling
  • Documentation

    • Updated component documentation to reflect new tag display mode and available configuration settings
  • Tests

    • Added comprehensive test coverage for tag rendering functionality

Review Change Stack

Sobyt483 added 4 commits May 25, 2026 12:47
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
@Sobyt483 Sobyt483 requested review from a team as code owners May 25, 2026 10:02
@Sobyt483 Sobyt483 self-assigned this May 25, 2026
@Sobyt483 Sobyt483 added the enhancement New feature or request label May 25, 2026
@Sobyt483 Sobyt483 moved this to In review in OpenMFP Development May 25, 2026
@Sobyt483 Sobyt483 linked an issue May 25, 2026 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@Sobyt483, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 47 minutes and 52 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 760b6fe7-3add-415f-bc5e-fdea94177e9d

📥 Commits

Reviewing files that changed from the base of the PR and between 2e7d393 and 833d134.

📒 Files selected for processing (1)
  • projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.html
📝 Walkthrough

Walkthrough

This PR introduces a new 'tag' display mode for the ValueCell component, enabling cells to render comma-separated or array-based values as individual ui5-tag chips. It adds a TagListValue component, updates the UiSettings type schema to support TagSettings configuration, removes the deprecated labelDisplay option, updates stories and configs to use the new mode, and refreshes documentation.

Changes

Tag Display Mode Implementation

Layer / File(s) Summary
Type contracts and tag settings schema
projects/ngx/declarative-ui/models/ui-definition.ts, docs/value-cell.md
Adds TagSettings interface (design, colorScheme, separator) and extends UiSettings.displayAs to include 'tag' with optional tagSettings? field; removes deprecated labelDisplay option.
TagListValue component and tests
projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.ts, tag-list-value.component.html, tag-list-value.component.scss, tag-list-value.component.spec.ts, projects/ngx/declarative-ui/value-cell/index.ts
New standalone Angular component that renders an array of tags as individual ui5-tag chips, accepts configurable design/colorScheme from tagSettings, and includes full unit test coverage for rendering, input propagation, and defaults.
ValueCell tag rendering integration
projects/ngx/declarative-ui/value-cell/value-cell.component.ts, value-cell.component.html, value-cell.component.scss, value-cell.component.spec.ts
Integrates TagListValue into ValueCell by adding tags computed property and normalizeTagsArray helper to parse string/array values; removes labelDisplay property and styling; updates template branching and adds tag-specific tests.
Configuration and story updates
projects/ngx/declarative-ui/stories/pods-table.config.ts, projects/ngx/declarative-ui/stories/declarative-table.stories.ts
Updates table column configs to use displayAs: 'tag' instead of labelDisplay: true; replaces grouped story with GroupedWithTagsAndAlert version and adds new Tags story showcasing custom separators and designs.
Template attribute and styling cleanup
projects/ngx/declarative-ui/table-card/declarative-table-card.component.html, projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.html, declarative-table.component.scss
Reorders template bindings for consistency (test-id grouped with styles, conditional styles alphabetized); adds .delimiter CSS class for 4px spacing; purely cosmetic changes with no behavioral impact.
Documentation updates
docs/declarative-table.md, docs/value-cell.md
Updates feature lists and tables to document 'tag' as the eighth display mode; adds "Tags" section describing string splitting, array handling, and configurable separators; documents TagListValue sub-component and removes labelDisplay from public API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • openmfp/webcomponents#133: Both PRs extend the public value-cell component exports—this PR adds TagListValue, while the retrieved PR added initial value-cell subcomponent exports.

Suggested labels

enhancement

Suggested reviewers

  • gkrajniak

Poem

🐰 Tags now twinkle in cells so bright,
With customizable colors and design in sight,
Arrays split clean, separators aligned,
Chips render with style, perfectly designed!
The label badge fades—a feature refined! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Tags display' clearly and concisely describes the main change: adding a new tags display mode to the ValueCell component.
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 tags-display

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

🧹 Nitpick comments (1)
projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.html (1)

2-2: ⚡ Quick win

Consider tracking by index instead of value.

The track tag expression tracks by value, which may cause rendering issues if the tags array contains duplicate strings. Angular could reuse DOM elements incorrectly in such cases.

🔄 Suggested improvement
-  `@for` (tag of tags(); track tag) {
+  `@for` (tag of tags(); track $index) {
🤖 Prompt for 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.

In
`@projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.html`
at line 2, The template currently tracks items by value using the expression
"track tag" in tag-list-value.component.html which breaks with duplicate
strings; change tracking to use the item index or an explicit trackBy function
instead—either update the loop to track the index (e.g., use the index variable
instead of tag: the `@for` expression should track the index like "track i" or
"track $index" depending on template syntax) or add a simple trackByIndex method
on TagListValueComponent (e.g., trackByIndex(index: number) { return index; })
and reference it in the template (e.g., "track trackByIndex") so DOM identity is
stable for duplicate tag values.
🤖 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.

Nitpick comments:
In
`@projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.html`:
- Line 2: The template currently tracks items by value using the expression
"track tag" in tag-list-value.component.html which breaks with duplicate
strings; change tracking to use the item index or an explicit trackBy function
instead—either update the loop to track the index (e.g., use the index variable
instead of tag: the `@for` expression should track the index like "track i" or
"track $index" depending on template syntax) or add a simple trackByIndex method
on TagListValueComponent (e.g., trackByIndex(index: number) { return index; })
and reference it in the template (e.g., "track trackByIndex") so DOM identity is
stable for duplicate tag values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 172bcb8e-1db7-4291-b8cc-86bf20ffa475

📥 Commits

Reviewing files that changed from the base of the PR and between d634a39 and 2e7d393.

📒 Files selected for processing (17)
  • docs/declarative-table.md
  • docs/value-cell.md
  • projects/ngx/declarative-ui/models/ui-definition.ts
  • projects/ngx/declarative-ui/stories/declarative-table.stories.ts
  • projects/ngx/declarative-ui/stories/pods-table.config.ts
  • projects/ngx/declarative-ui/table-card/declarative-table-card.component.html
  • projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.html
  • projects/ngx/declarative-ui/table/declarative-table/declarative-table.component.scss
  • projects/ngx/declarative-ui/value-cell/index.ts
  • projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.html
  • projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.scss
  • projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.spec.ts
  • projects/ngx/declarative-ui/value-cell/tag-list-value/tag-list-value.component.ts
  • projects/ngx/declarative-ui/value-cell/value-cell.component.html
  • projects/ngx/declarative-ui/value-cell/value-cell.component.scss
  • projects/ngx/declarative-ui/value-cell/value-cell.component.spec.ts
  • projects/ngx/declarative-ui/value-cell/value-cell.component.ts
💤 Files with no reviewable changes (1)
  • projects/ngx/declarative-ui/value-cell/value-cell.component.scss

Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Comment thread docs/value-cell.md
interface TagSettings {
design?: 'Neutral' | 'Positive' | 'Critical' | 'Negative' | 'Information' | 'Set1' | 'Set2';
colorScheme?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10'; // default '1'
separator?: string; // default ','
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.

I have a temptetion to rename it to valueSeparator, what do you think?

@Sobyt483 Sobyt483 merged commit d8db1c3 into main May 25, 2026
9 checks passed
@Sobyt483 Sobyt483 deleted the tags-display branch May 25, 2026 11:26
@github-project-automation github-project-automation Bot moved this from In review to Done in OpenMFP Development May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Simplify the UiSettings API

2 participants