Skip to content

Resize drag drop adjustments#213

Draft
Sobyt483 wants to merge 8 commits into
mainfrom
resize-drag-drop-adjustments
Draft

Resize drag drop adjustments#213
Sobyt483 wants to merge 8 commits into
mainfrom
resize-drag-drop-adjustments

Conversation

@Sobyt483

@Sobyt483 Sobyt483 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Z-flow engine is implemented as well as resize snap behavior.

But we need to decide do we want to enable it for all users without other options. Or it should be configured. Because to achieve snap behavir I've changed columns from 12 to 4 + for z-flow it's crucial that all cards have same height otherwise it wouldn't work.

@gkrajniak Would be good to have a call to discuss all possible options.

Sobyt483 added 6 commits July 21, 2026 17:15
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>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
Signed-off-by: Sobyt483 <andrianingomel@gmail.com>
@Sobyt483 Sobyt483 self-assigned this Jul 23, 2026
@Sobyt483
Sobyt483 requested a review from a team as a code owner July 23, 2026 14:04
@Sobyt483 Sobyt483 added the enhancement New feature or request label Jul 23, 2026
@Sobyt483
Sobyt483 requested review from a team as code owners July 23, 2026 14:04
@Sobyt483 Sobyt483 moved this to In review in OpenMFP Development Jul 23, 2026
@Sobyt483
Sobyt483 marked this pull request as draft July 23, 2026 14:04
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2b670dc4-f270-4888-861f-ec9b4e54dbf1

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

Walkthrough

The dashboard adds Z-flow ordering and projection for drag and resize operations, drag-origin placeholder rendering, shared card surface markers, and responsive card sizing changes at the XL breakpoint.

Changes

Dashboard layout behavior

Layer / File(s) Summary
Z-flow projection and stepped resize
projects/ngx/declarative-ui/dashboard/dashboard/z-flow.helpers.ts, projects/ngx/declarative-ui/dashboard/dashboard/stepped-resize-engine.ts, projects/ngx/declarative-ui/dashboard/dashboard/resize.helpers.ts, projects/ngx/declarative-ui/dashboard/dashboard/*spec.ts
Adds Z-flow ordering, projected placement, insertion-slot resolution, stepped resize widths, engine notifications, and corresponding tests.
Drag lifecycle and origin placeholder
projects/ngx/declarative-ui/dashboard/card/*, projects/ngx/declarative-ui/dashboard/constants/constants.ts, projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.*
Wires drag callbacks, computes drag-origin geometry, commits ordering on drag stop, renders the placeholder, and applies a shared drag-origin class to card surfaces.
Breakpoint column and card sizing
projects/ngx/declarative-ui/dashboard/constants/*, projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts
Changes breakpoint column mappings to four columns, adds XL_PAGE, and remaps card width settings when crossing the XL threshold.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GridStack
  participant Dashboard
  participant SteppedResizeGridStackEngine
  participant CardSurface
  participant DragOriginPlaceholder
  GridStack->>Dashboard: onDragStart(event)
  Dashboard->>CardSurface: locate drag-origin surface
  Dashboard->>DragOriginPlaceholder: set origin geometry
  GridStack->>SteppedResizeGridStackEngine: moveNodeCheck(node, opts)
  SteppedResizeGridStackEngine->>Dashboard: update projected card geometry
  GridStack->>Dashboard: onDragStop()
  Dashboard->>SteppedResizeGridStackEngine: commitZFlowLayout()
  Dashboard->>DragOriginPlaceholder: clear origin style
Loading

Suggested reviewers: gkrajniak

🚥 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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the PR’s main focus on resize and drag/drop behavior changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch resize-drag-drop-adjustments

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.

@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

🧹 Nitpick comments (1)
projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts (1)

497-536: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

No visible test coverage for the XL breakpoint w/maxW remap.

changeCardSettingsForXlPage/updateCardsForBreakpoint toggle each card's w/maxW between 3 and 4 whenever the XL threshold is crossed, gated by isXLPage. This bidirectional remap (and the isXLPage state machine) doesn't appear to be exercised by any test in the diff. Given it mutates persisted card geometry, a couple of unit tests (crossing the threshold each direction, and no-op when already in that state) would guard against regressions.

🤖 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/dashboard/dashboard.component.ts`
around lines 497 - 536, Add unit tests for changeCardSettingsForXlPage covering
transitions into and out of the XL threshold, asserting the expected w/maxW
remapping and isXLPage state; also verify repeated calls while already in the
target state are no-ops. Mock or accommodate updateCardsForBreakpoint and
afterNextRender as needed without changing production behavior.
🤖 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/constants/_breakpoints.scss`:
- Around line 27-29: Synchronize the $dashboard-breakpoints table with the
updated four-column values used by $dashboard-cols-md, $dashboard-cols-lg, and
$dashboard-cols-xl, including its XL comment. If the table is no longer used,
remove it instead while preserving the file’s shared breakpoint contract.

In `@projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.scss`:
- Around line 197-199: Update the Stylelint configuration’s
selector-type-no-unknown rule to ignore the custom element types gridstack and
gridstack-item, preserving the existing gridstack selector while allowing it to
pass lint.

In `@projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.spec.ts`:
- Line 5: Update the dashboard component spec’s gridstack mocking so the
GridStackEngine import consumed by SteppedResizeGridStackEngine resolves to a
mock before the module is imported. Extend the existing gridstack mock to
include gridstack/dist/gridstack-engine, or add an equivalent module mock for
that path, while preserving the current drag test behavior.

In `@projects/ngx/declarative-ui/dashboard/dashboard/resize.helpers.ts`:
- Around line 7-27: Update resolveResizeWidthStep to explicitly handle an empty
result from getAllowedResizeWidths when minWidth exceeds effectiveMax, returning
a valid fallback width rather than undefined. Preserve the existing
nearest-candidate selection for non-empty allowed sets and ensure callers such
as moveNodeCheckWithSteppedResize receive a usable width.

---

Nitpick comments:
In `@projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts`:
- Around line 497-536: Add unit tests for changeCardSettingsForXlPage covering
transitions into and out of the XL threshold, asserting the expected w/maxW
remapping and isXLPage state; also verify repeated calls while already in the
target state are no-ops. Mock or accommodate updateCardsForBreakpoint and
afterNextRender as needed without changing production behavior.
🪄 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 Plus

Run ID: 70325535-e66d-43dd-bb98-a1409c05136a

📥 Commits

Reviewing files that changed from the base of the PR and between 7a5e434 and b58a42b.

📒 Files selected for processing (15)
  • projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.html
  • projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.spec.ts
  • projects/ngx/declarative-ui/dashboard/card/dashboard-card.component.ts
  • projects/ngx/declarative-ui/dashboard/constants/_breakpoints.scss
  • projects/ngx/declarative-ui/dashboard/constants/breakpoints.ts
  • projects/ngx/declarative-ui/dashboard/constants/constants.ts
  • 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.spec.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/dashboard.component.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/resize.helpers.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/stepped-resize-engine.spec.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/stepped-resize-engine.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/z-flow.helpers.spec.ts
  • projects/ngx/declarative-ui/dashboard/dashboard/z-flow.helpers.ts

Comment thread projects/ngx/declarative-ui/dashboard/constants/_breakpoints.scss
Comment thread projects/ngx/declarative-ui/dashboard/dashboard/resize.helpers.ts
Sobyt483 and others added 2 commits July 23, 2026 18:48
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: In review

1 participant