Repository navigation
Conversation
Adds the building blocks of a grid view: a canvas that places widgets on a 12 column grid with gridstack, the card around each widget, and the header and text widgets. The widget types are loaded from the server. - the grid reflows to 6 and 1 columns on narrower screens, while the stored layout keeps the 12 column positions - in edit mode widgets can be dragged and resized, or moved and resized from the widget menu with the keyboard - colors from widget content are applied only when they are hex values Co-authored-by: Ruben van der Linde <[email protected]> Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Remko <[email protected]>
…azily - on a canvas narrower than 12 columns drag, resize and the move actions are off with a hint, since that reflow is only shown and never stored - widget types load the first time a widget needs them, in one request, instead of on every app start - the column choice and the layout mapping are pure, named functions with component tests, together with the widget defaults, the grid copy and the hex color check - one deep copy for defaults and grids, which also copies reactive data - a header widget's heading sits below the card's own heading - widgets no longer get an editable attribute they do not declare, and the grid baseline variable is used without a fallback Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Remko <[email protected]>
- the grid constants and pure helpers move to gridLayout.js, widgetRegistry.js only maps widget types to components - move and resize steps are disabled when they cannot apply - a widget card is labelled by its visible heading, and editor placeholders only show while the page is edited - data-cy names are camelCase, the edit outline uses the max-contrast border and the header subtitle no longer lowers contrast with opacity - GridStack and the resize observer are no longer reactive state, so they need no markRaw; the margin is a named constant - one comment style, JSDoc on every method and one way to use icons Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Remko <[email protected]>
3178aaf to
aa62e3c
Compare
Signed-off-by: Remko <[email protected]>
Signed-off-by: Remko <[email protected]> Assisted-by: ClaudeCode:claude-opus-5-5
aa62e3c to
b64ea53
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
Closing this in favour of the new stack that starts at #3131. After the review on #3075, @enjeck's design in #3099 and #3100 replaced the model these PRs were built on, so they can't be updated in place. The backend of grid pages and application menus is now in #3131 to #3138. The frontend follows in separate PRs. @remko48 is co-author on the menu commits there. Thanks to everyone who reviewed these. |
Frontend building blocks to show a grid view: a canvas that places widgets on a grid, the card around each widget, and the first two widget types (header and text). Nothing uses them yet; the grid view page comes in a later PR of this stack.
What changes
gridstackfor the grid layout (drag, resize, reflow). It does the hard part of a dashboard grid; writing that ourselves would be a lot more code to maintain.GridCanvas: 12 columns on a wide screen, 6 on a medium one, 1 on a phone, based on the canvas width. A narrower layout is only how the page is shown; the stored layout always stays the 12-column one. Widgets can therefore only be arranged at full width: on a narrow screen edit mode shows a hint instead.GridWidget: the card with an optional title and, in edit mode, a menu to configure, remove, move and resize the widget, so the grid can be arranged with the keyboard as well as by dragging. In edit mode the card always shows a heading, the widget's title or else its type name.HeaderWidget(heading, subheading, alignment, colors) andTextWidget(paragraphs, split on empty lines). Colors are only applied when they are hex, the same rule as the backend.GET /api/2/views/widget-typesthe first time a widget is shown, with one shared request; the frontend only maps each type to the component that renders it.🖼️ Screenshots
No visible change yet, since nothing renders the canvas until the grid view page PR.
🏁 Checklist
/backport to stableX.X🤖 AI (if applicable)