Skip to content

Counter badge for grid advanced props#6468

Merged
ruggi merged 5 commits into
masterfrom
feat/grid-advanced-menu-counter-badge
Oct 4, 2024
Merged

Counter badge for grid advanced props#6468
ruggi merged 5 commits into
masterfrom
feat/grid-advanced-menu-counter-badge

Conversation

@ruggi
Copy link
Copy Markdown
Contributor

@ruggi ruggi commented Oct 3, 2024

Problem:

The grid advanced menu should show a badge with a counter for the number of properties set.

Fix:

  1. Show a badge to the side of the grid subsection title, if the count is > 0 and the popup/menu are not open
  2. Show a badge in the menu entry if the count is > 0
Kapture.2024-10-03.at.16.55.41.mp4

Fixes #6467

@ruggi ruggi mentioned this pull request Oct 3, 2024
2 tasks
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 3, 2024

Try me

@relativeci
Copy link
Copy Markdown

relativeci Bot commented Oct 3, 2024

#14565 Bundle Size — 57.79MiB (~+0.01%).

a6d3d2d(current) vs 916e8b9 master#14558(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#14565
     Baseline
#14558
Regression  Initial JS 40.74MiB(+0.01%) 40.74MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.03% 18.02%
No change  Chunks 23 23
No change  Assets 25 25
Change  Modules 4108(+0.05%) 4106
No change  Duplicate Modules 214 214
No change  Duplicate Code 27.47% 27.47%
No change  Packages 475 475
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#14565
     Baseline
#14558
Regression  JS 57.78MiB (~+0.01%) 57.78MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch feat/grid-advanced-menu-counter-...Project dashboard


Generated by RelativeCIDocumentationReport issue


return advancedGridProps.reduce((acc, curr) => {
const attr = getSimpleAttributeAtPath(props, curr)
return isRight(attr) && attr.value != null ? acc + 1 : acc
Copy link
Copy Markdown
Contributor

@gbalint gbalint Oct 3, 2024

Choose a reason for hiding this comment

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

It would be nice to create a count function in array-utils for this (for the note, a filter + length could work too)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could use an optic and lengthOf.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

factored out to array-utils.ts in f525303 (#6468), but then moved it element-metadata-utils.ts in a6d3d2d (#6468) because of a failing import loop

@ruggi ruggi merged commit 0813b99 into master Oct 4, 2024
@ruggi ruggi deleted the feat/grid-advanced-menu-counter-badge branch October 4, 2024 08:27
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**

The grid advanced menu should show a badge with a counter for the number
of properties set.

**Fix:**

1. Show a badge to the side of the grid subsection title, if the count
is > 0 and the popup/menu are not open
2. Show a badge in the menu entry if the count is > 0



https://github.com/user-attachments/assets/1f58f8ba-7f27-442f-8a07-816f7474d9be



Fixes #6467
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.

grid advanced props counter badge

4 participants