Skip to content

feat(applications): personal layout for the standalone overview - #31

Open
remko48 wants to merge 3 commits into
stack/d3-applications-pagefrom
stack/d4-per-user-layout
Open

remko48 wants to merge 3 commits into
stack/d3-applications-pagefrom
stack/d4-per-user-layout

Conversation

@remko48

@remko48 remko48 commented Oct 14, 2026

Copy link
Copy Markdown
Member

Opened on its own, an application now shows its tables and views as cards on a grid, and each person can choose how wide each card is.

What changes

  • Grid: the tables and views sit on a 12-column grid, which narrows to 6 columns and then to one column on smaller screens.
  • Widths: "Edit layout" lets a person give each card full width, two thirds, half or one third; "Reset layout" goes back to the default, and the layout is saved or cancelled as a whole.
  • Storage: the layout is personal and kept in the browser (local storage), per user and application. It does not follow the user to another browser or device. When the browser refuses to store it, the layout applies to the current visit only and the user is told so.
  • Tests: a Cypress component test covers storing, resetting and reading the layout; a Playwright test checks that a chosen width survives a reload.

🖼️ Screenshots

🏚️ Before 🏡 After
|

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- opened on its own, an application shows its tables and views as cards
  on a 12-column grid that narrows on smaller screens
- each person can give a card full, two thirds, half or one third of the
  width, and reset it to the default
- the layout is kept per user in this browser; when the browser refuses to
  store it, it applies to the current visit only and says so

Signed-off-by: Remko <remko@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
@remko48
remko48 added this pull request to stack #32 October 14, 2026 10:03
@remko48
remko48 removed this pull request from stack #32 October 14, 2026 10:21
@remko48
remko48 added this pull request to stack #33 October 14, 2026 10:21
@remko48 remko48 closed this Oct 14, 2026
@remko48 remko48 reopened this Oct 14, 2026
NcActions with a menu name is named after that name, not after its aria-label, so the test finds the menu in the card's toolbar instead.

Signed-off-by: Remko <remko@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
export function getGridCellStyle(span) {
return {
'--context-grid-span': span,
'--context-grid-span-medium': Math.min(span, GRID_COLUMNS_MEDIUM),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🟢 Minor — on the 6-column breakpoint, "One third" leaves a hole and "Half" goes full width

Math.min(span, 6) turns 12, 8 and 6 into full width and 4 into 4. Two one-third cards (4 + 4) don't fit in 6 columns, so each one sits on its own row next to a 2-column gap.

Impact: gaps and skewed proportions on medium screens.

Suggested fix: halve the span (12/8/6/4 → 6/4/3/2), and update the Cypress expectation that pins the current behaviour.

Comment thread src/pages/Context.vue
border-bottom: 1px solid var(--color-border);
}

@media (max-width: 900px) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🟢 Minor — the breakpoints follow the viewport, not the space the grid actually has

Opened on its own, the application keeps its navigation (about 300 px) open. At a 1100 px viewport the grid has about 800 px and still gets 12 columns, so "One third" cards hold full tables in about 250 px.

Impact: cramped cards while the screen counts as wide.

Suggested fix: container-type: inline-size on .context__grid, with @container rules instead of @media.

Comment thread src/pages/Context.vue
this.loading = true
this.contextResources = []
this.resourceViewSettings = {}
this.layout = loadContextLayout(this.activeContextId)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🟢 Minor — any reload throws away a layout edit in progress

reload() sets draftLayout = null on the next line, and it runs on every context-signature change (for example a resource added in another tab).

Impact: unsaved widths are lost without notice.

Suggested fix: only reset the draft when the application id changes.

Comment thread src/pages/Context.vue

<div v-if="!selectedMenuItem && isStandalone" class="resources">
<div v-for="resource in contextResources" :key="resource.key">
<div v-if="!selectedMenuItem && isStandalone" class="context__layout-toolbar" data-cy="context-layout-toolbar">

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🟢 Minor — "Edit layout" shows when there is nothing to lay out

The toolbar also renders when contextResources is empty, for example an application with only grid pages.

Impact: an edit button over an empty page.

Suggested fix: add && contextResources.length > 0.

window.localStorage.removeItem(getStorageKey(contextId))
return
}
window.localStorage.setItem(getStorageKey(contextId), JSON.stringify(layout))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🟢 Minor (question) — the layout is kept per browser, not per user

The PR says so openly, so this is a check on the product choice. Nextcloud user preferences would let the layout follow the person to other devices. Stored keys are also never cleaned up after an application or resource is deleted.

Impact: the layout doesn't follow the user to other devices; stale keys accumulate.

Suggested fix: confirm that browser-only storage is intended; if so, consider pruning unknown resource keys on load.

@rubenvdlinde

Copy link
Copy Markdown
Collaborator

Superseded by #45 (rebuilt on application pages, see #13).

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.

2 participants