feat(dashboard): add layout/position flags to widget edit and add commands#591
Merged
feat(dashboard): add layout/position flags to widget edit and add commands#591
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Dashboard
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 99.41%. Project has 1269 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.68% 95.69% +0.01%
==========================================
Files 202 202 —
Lines 29253 29415 +162
Branches 0 0 —
==========================================
+ Hits 27987 28146 +159
- Misses 1266 1269 +3
- Partials 0 0 —Generated by Codecov Action |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
…mands Add --x, --y, --width, --height flags to `dashboard widget edit` and `dashboard widget add` commands so users can control widget position and size in the 6-column dashboard grid. - `widget edit`: partial overrides supported — omitted values preserve existing layout - `widget add`: explicit values override auto-layout defaults - Validation enforces grid bounds (x: 0–5, width: 1–6, x+width ≤ 6) - Human output now shows layout info for edited/added widgets - Regenerated SKILL.md Closes #540
Replace magic numbers { x: 0, y: 0, w: 3, h: 2 } with a shared
FALLBACK_LAYOUT constant exported from dashboard.ts.
…aults The initial validateWidgetLayout(flags) call only validates individual flag ranges. When only --x is provided, cross-validation (x + width) was skipped because width was undefined. After assignDefaultLayout fills in the default width, the merged layout could overflow the grid. Now re-validates the final merged layout to catch cross-dimensional overflow (e.g., --x 5 on a table widget with auto-width 6).
…outless widgets Same pattern as the add command fix — when an existing widget has no layout, the early validateWidgetLayout call can't cross-validate x+width because the fallback dimensions aren't known yet. Now re-validates the merged replacement layout when the existing widget had no layout.
d1bbd8d to
b8b7d97
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
--x,--y,--width,--heightflags todashboard widget editanddashboard widget addcommands for controlling widget position and size in the 6-column dashboard gridwidget edit— omitted layout values preserve the existing layoutwidget add, explicit layout values override auto-layout defaultsx: 0–5,width: 1–6,x + width ≤ 6,height ≥ 1)Layout: position (x,y), size w×h) for edited/added widgetsCloses #540