Skip to content

Adjustments after review#171

Open
gkrajniak wants to merge 8 commits into
mainfrom
feat/adjust-ref-2
Open

Adjustments after review#171
gkrajniak wants to merge 8 commits into
mainfrom
feat/adjust-ref-2

Conversation

@gkrajniak

@gkrajniak gkrajniak commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Improvements

    • Better drag-and-drop: consistent grabbing cursor and visual state while dragging
    • Resize handles and edit highlights remain visible during active interactions
    • More responsive dashboard grid using container-based breakpoints; sections can span full width
    • Accessibility: improved accessible names and button/description bindings
  • Style

    • Minor visual tweaks and updated card preview height for example dashboards (Pods Table taller)

Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
@gkrajniak gkrajniak requested review from a team as code owners June 11, 2026 07:54
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 42783f25-f2d4-4c5d-933d-87e3afaa7fbc

📥 Commits

Reviewing files that changed from the base of the PR and between ae29745 and 5cf1778.

📒 Files selected for processing (1)
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts

📝 Walkthrough

Walkthrough

This PR centralizes dashboard breakpoint logic from hardcoded media queries into TypeScript and SCSS constants, migrates to container queries for responsive layout, makes section column defaults optional to inherit responsive defaults, and improves card editing UX with grab/grabbing cursor feedback during drag operations.

Changes

Dashboard Responsive Layout & Card Editing UX

Layer / File(s) Summary
Breakpoint model and constants
projects/ngx/declarative-ui/dashboard/models/breakpoints.ts, projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss, projects/ngx/declarative-ui/dashboard/models/index.ts
Introduces TypeScript constant DASHBOARD_BREAKPOINTS and SCSS variables/mixin dashboard-grid-columns as a shared source-of-truth for responsive dashboard layout, with documentation requiring synchronized updates across both implementations.
Dashboard container-query integration
projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts, projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss, projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html
Switches dashboard from hardcoded media queries to container-query approach using shared breakpoints, updates gridOptions to reference DASHBOARD_BREAKPOINTS with sizeToContent: true, refactors template bindings for accessibility, and removes hardcoded columns prop from section component.
Dashboard section responsive defaults
projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.ts, projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.scss, projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.html
Makes columns input optional to inherit responsive CSS defaults, updates host grid-column binding to support full-width sections, replaces explicit grid-template-columns with breakpoint mixin using --cols CSS variable override.
Card editing and drag/resize visual feedback
projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html, projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss
Adds grab/grabbing cursor styling for edit mode and Gridstack drag states, reorders template to render resize indicator earlier in edit-mode block, adjusts resize-indicator position to account for card padding, and adds :host-context(.ui-draggable-dragging) overrides to preserve highlight and resize visuals during drag.
Story fixture card height updates
projects/ngx/declarative-ui/stories/dashboard.cards.ts, projects/ngx/declarative-ui/stories/dashboard.stories.ts
Increases table-pods card height from 35 to 45 in both fixture files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • openmfp/webcomponents#135: Accessibility-focused updates to accessibleName bindings on UI5 buttons in dashboard templates, overlapping with this PR's template refactoring.
  • openmfp/webcomponents#170: Related modifications to dashboard card editing UI including resize-corner indicator rendering and edit-state styling adjustments.
  • openmfp/webcomponents#155: Changes to card padding CSS variables that affect resize indicator positioning used in this PR.

Suggested labels

enhancement

Suggested reviewers

  • lpgarzonr

Poem

🐰 I stitched breakpoints, CSS and TypeScript tight,
Container queries hum through day and night,
Cards now grab and drag without a fight,
Resize corners sit snugly in their right,
A little rabbit hops—responsive delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'Adjustments after review' is vague and generic, failing to convey what specific changes were made or which components were modified. Consider a more descriptive title that summarizes the main change, such as 'Refactor dashboard responsive layout to use container queries' or 'Migrate dashboard breakpoints to shared model'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/adjust-ref-2

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
projects/ngx/declarative-ui/stories/dashboard.stories.ts (1)

48-60: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Eliminate duplication of table-pods card configuration.

The table-pods card configuration is duplicated between this file (AVAILABLE_CARDS) and dashboard.cards.ts (CARDS array). This duplication required synchronized updates in this PR and creates maintenance risk—future changes must be applied in both locations or the fixtures will drift.

Consider extracting the shared configuration to a constant or factory function that both arrays can reference. The label field can be added conditionally where needed.

♻️ Suggested approach

In dashboard.cards.ts, extract a shared factory:

export const createTablePodsCard = (overrides?: Partial<CardConfig>): CardConfig => ({
  id: 'table-pods',
  w: 12,
  h: 45,
  component: 'mfp-wc-declarative-table-card',
  componentInputs: {
    config: TABLE_CARD_CONFIG,
    header: 'Pods',
    headerTooltip: 'This table lists all pods running in the cluster.',
    resources: TABLE_RESOURCES,
  },
  ...overrides,
});

Then use it in both files:

// In dashboard.cards.ts
export const CARDS: CardConfig[] = [
  // ... other cards
  createTablePodsCard(),
];

// In dashboard.stories.ts
const AVAILABLE_CARDS: CardConfig[] = [
  createTablePodsCard({ label: 'Pods Table' }),
  // ... other cards
];
🤖 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/stories/dashboard.stories.ts` around lines 48 -
60, The table-pods card config is duplicated between AVAILABLE_CARDS and the
CARDS array; extract the shared object into a factory or constant (e.g.,
createTablePodsCard or TABLE_PODS_CONFIG) that returns the base CardConfig for
id 'table-pods' (including w, h, component, componentInputs with
TABLE_CARD_CONFIG/TABLE_RESOURCES and header/headerTooltip), then replace the
inline definition in AVAILABLE_CARDS with a call to that factory and pass {
label: 'Pods Table' } as an override where the label is only needed; update
CARDS to use the same factory without the label to remove duplication.
🧹 Nitpick comments (2)
projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss (1)

51-68: ⚡ Quick win

Consider consolidating drag-state rules.

The three :host-context(.ui-draggable-dragging) rule blocks (lines 54-56, 61-64, 66-68) could be consolidated into a single nested rule to reduce duplication and improve maintainability.

♻️ Proposed consolidation
-// Gridstack adds .ui-draggable-dragging to the <gridstack-item> wrapping this
-// card while a drag is active. Override the open-palm `grab` cursor with the
-// closed-fist `grabbing` cursor for the duration of the drag.
-:host-context(.ui-draggable-dragging) .component-card--editing {
-  cursor: grabbing !important;
-}
-
-// Keep the edit-mode highlight (blue border + resize-corner icon) visible on
-// the dragged card. The browser stops firing :hover events during a drag, so
-// we re-apply the same styles using the same Gridstack hook used for cursor.
-:host-context(.ui-draggable-dragging) .component-card--editing {
-  --sapTile_BorderColor: var(--sapHighlightColor, `#0070f2`);
-  --sapGroup_ContentBorderColor: var(--sapHighlightColor, `#0070f2`);
-}
-
-:host-context(.ui-draggable-dragging) .component-card--editing .card__resize-indicator {
-  opacity: 1;
-}
+// Gridstack adds .ui-draggable-dragging to the <gridstack-item> wrapping this
+// card while a drag is active. Override the open-palm `grab` cursor with the
+// closed-fist `grabbing` cursor, and keep the edit-mode highlight (blue border
+// + resize-corner icon) visible (the browser stops firing :hover during drag).
+:host-context(.ui-draggable-dragging) .component-card--editing {
+  cursor: grabbing !important;
+  --sapTile_BorderColor: var(--sapHighlightColor, `#0070f2`);
+  --sapGroup_ContentBorderColor: var(--sapHighlightColor, `#0070f2`);
+
+  .card__resize-indicator {
+    opacity: 1;
+  }
+}
🤖 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/dashboard/card/dashboard-card.component.scss`
around lines 51 - 68, Multiple CSS blocks target the same host-context drag
state; consolidate by combining the three :host-context(.ui-draggable-dragging)
rule blocks into a single rule that nests all selectors for
.component-card--editing and .component-card--editing .card__resize-indicator so
the cursor: grabbing, the custom properties (--sapTile_BorderColor,
--sapGroup_ContentBorderColor) and the opacity: 1 for .card__resize-indicator
are applied together under one :host-context(.ui-draggable-dragging) selector to
remove duplication and improve maintainability.
projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss (1)

12-18: Breakpoints in _breakpoints.scss align with DASHBOARD_BREAKPOINTS (TypeScript).

  • SCSS sets columns at max-widths 599→4, 1023→8, 1439→12, and uses the default 14 columns above 1439—matching the TS entries (including the { w: 4000, c: 14 } ceiling for Gridstack).
  • Line 3 is a standalone // spacer; if scss/comment-no-empty (or similar) is enforced, replace it with a non-empty comment.
🤖 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/dashboard/models/_breakpoints.scss` around lines
12 - 18, The SCSS variable $dashboard-breakpoints contains a standalone "//"
empty spacer comment which violates scss/comment-no-empty; update the spacer to
a non-empty comment (e.g., explain the default 14-column behavior or reference
DASHBOARD_BREAKPOINTS) so the comment is not empty, keeping the existing
breakpoint tuples ((599, 4), (1023, 8), (1439, 12)) and the explanatory lines
about the default 14 columns and 4000 ceiling intact.
🤖 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/dashboard/card/dashboard-card.component.scss`:
- Line 77: Add an empty line immediately before the inline SCSS comment "//
Anchored to the .component-card edges. The card has horizontal padding" in
dashboard-card.component.scss to satisfy the
scss/double-slash-comment-empty-line-before Stylelint rule; simply insert a
blank line above that comment so the linter no longer flags the double-slash
comment.

In `@projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss`:
- Around line 19-26: Insert a single blank line immediately before the
double-slash comment that begins "// Acts as the inline-size query container..."
in the dashboard component SCSS so the comment is separated from the preceding
declaration (the line with padding). Leave the surrounding rules and properties
(container-type: inline-size; container-name: mfp-dashboard; and any references
to .mfp-sections-container) unchanged; this satisfies the
scss/double-slash-comment-empty-line-before lint rule.

In `@projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts`:
- Around line 6-7: Merge the two duplicate imports from '../models' into a
single import statement: import CardConfig, DashboardConfig, SectionConfig and
DASHBOARD_BREAKPOINTS together from '../models' (i.e., replace the separate
imports for CardConfig/DashboardConfig/SectionConfig and DASHBOARD_BREAKPOINTS
with one consolidated import that includes all four symbols) to resolve the
no-duplicate-imports lint error.

In `@projects/ngx/declarative-ui/dashboard/models/breakpoints.ts`:
- Around line 30-32: Replace the explicit ReadonlyArray<> form with the readonly
T[] array notation for DASHBOARD_BREAKPOINTS: update the type of the exported
DASHBOARD_BREAKPOINTS constant (the declaration using
ReadonlyArray<Readonly<Required<Pick<Breakpoint, 'w' | 'c'>> & { layout:
LayoutStrategy }>>) to use the readonly array shorthand (readonly ...[]) so it
satisfies the `@typescript-eslint/array-type` rule while keeping the inner
Readonly/Required/Pick composition intact.

---

Outside diff comments:
In `@projects/ngx/declarative-ui/stories/dashboard.stories.ts`:
- Around line 48-60: The table-pods card config is duplicated between
AVAILABLE_CARDS and the CARDS array; extract the shared object into a factory or
constant (e.g., createTablePodsCard or TABLE_PODS_CONFIG) that returns the base
CardConfig for id 'table-pods' (including w, h, component, componentInputs with
TABLE_CARD_CONFIG/TABLE_RESOURCES and header/headerTooltip), then replace the
inline definition in AVAILABLE_CARDS with a call to that factory and pass {
label: 'Pods Table' } as an override where the label is only needed; update
CARDS to use the same factory without the label to remove duplication.

---

Nitpick comments:
In `@projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss`:
- Around line 51-68: Multiple CSS blocks target the same host-context drag
state; consolidate by combining the three :host-context(.ui-draggable-dragging)
rule blocks into a single rule that nests all selectors for
.component-card--editing and .component-card--editing .card__resize-indicator so
the cursor: grabbing, the custom properties (--sapTile_BorderColor,
--sapGroup_ContentBorderColor) and the opacity: 1 for .card__resize-indicator
are applied together under one :host-context(.ui-draggable-dragging) selector to
remove duplication and improve maintainability.

In `@projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss`:
- Around line 12-18: The SCSS variable $dashboard-breakpoints contains a
standalone "//" empty spacer comment which violates scss/comment-no-empty;
update the spacer to a non-empty comment (e.g., explain the default 14-column
behavior or reference DASHBOARD_BREAKPOINTS) so the comment is not empty,
keeping the existing breakpoint tuples ((599, 4), (1023, 8), (1439, 12)) and the
explanatory lines about the default 14 columns and 4000 ceiling intact.
🪄 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: 395d6974-fc08-413a-a838-78476b4388b2

📥 Commits

Reviewing files that changed from the base of the PR and between ffa8b74 and ae29745.

📒 Files selected for processing (13)
  • projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html
  • projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.scss
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.html
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts
  • projects/ngx/declarative-ui/dashboard/models/_breakpoints.scss
  • projects/ngx/declarative-ui/dashboard/models/breakpoints.ts
  • projects/ngx/declarative-ui/dashboard/models/index.ts
  • projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.html
  • projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.scss
  • projects/ngx/declarative-ui/dashboard/section/dashboard-section.component.ts
  • projects/ngx/declarative-ui/stories/dashboard.cards.ts
  • projects/ngx/declarative-ui/stories/dashboard.stories.ts

Comment thread projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts Outdated
Comment thread projects/ngx/declarative-ui/dashboard/models/breakpoints.ts
@gkrajniak gkrajniak requested a review from lpgarzonr June 11, 2026 08:32
Signed-off-by: gkrajniak <gkrajniak@gmail.com>
@gkrajniak gkrajniak linked an issue Jun 11, 2026 that may be closed by this pull request
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.

Resize improvments

1 participant