Skip to content

feat(admin-settings): use the web-pkg spaces store, add the customize menu and space images - #3501

Merged
AlexAndBear merged 26 commits into
mainfrom
feat/admin-settings-spaces-store-and-images
Oct 1, 2026
Merged

AlexAndBear merged 26 commits into
mainfrom
feat/admin-settings-spaces-store-and-images

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description

The admin settings spaces list now uses the spaces store of web-pkg instead of its own copy of the spaces. With that, the space actions of the files app update the admin list on their own, the admin space context menu gets the same Customize submenu as the files app, and the spaces list shows (and updates) the space images.

Why: the old design

The admin settings kept its own spaces store, so every space action of the files app had to know about the admin settings route and patch the admin copy of the space by hand, e.g. in useSpaceActionsEditDescription:

spacesStore.updateSpaceField({ id: space.id, field: 'description', value: description })
if (unref(route).name === 'admin-settings-spaces') {
  space.description = description
}

The same pattern existed for rename, disable and restore; delete and quota changes published admin-only events (app.admin-settings.list.load, app.admin-settings.spaces.space.quota.updated) and the admin view mirrored spaces created via the FAB with a $onAction hook. Actions that didn't do this (set image/icon, delete image, the permission loading needed by the Customize actions) simply never reached the admin list.

Spaces store (web-pkg)

What changed Why
New allProjectSpaces collection with setAllProjectSpaces(), undefined unless the admin settings loaded it The admin settings needs all project spaces, including the ones the user isn't a member of. spaces stays "the spaces of the current user", which the files app and the runtime rely on (Projects view, trash overview, drive resolution, SSE, …)
upsertSpace and updateSpaceField apply to both collections, removeSpace too unless called with { deleted: false } One update path for every space action, no admin special cases needed. A space the user only lost access to (SSE "member removed") is removed from spaces but stays in allProjectSpaces, it still exists
allProjectSpaces holds its own space objects, separate from spaces Updating the user's copy of a space must not overwrite the admin data (e.g. its members)
loadGraphPermissions works on both collections (a copy without permissions is loaded even if the other copy has them already), treats a 404 (user isn't a member) as "no permissions" and always clears its loading state The Customize actions check the user's permissions in the space; a space opened in the files app before had permissions in spaces only, so the batch actions of the admin settings kept spinning. A failed request previously stayed "loading" forever and was awaited again on every call

Admin settings

What changed Why
The spaces list and view use spacesStore.allProjectSpaces, the admin spaceSettingsStore only keeps the selection Single source of truth for space data
Removed the mirroring of FAB-created spaces into the admin store, the app.admin-settings.list.load and quota events The store updates the list directly
Spaces upserted without their members (created via the FAB, members added in the create dialog, restored, SSE updates, …) get their members loaded again with root($expand=permissions) via a $onAction hook on upsertSpace; only the response of the latest request per space is applied Responses like createDrive/getDrive/updateDrive don't contain the members, so the manager/members columns showed "-" or outdated members until a reload
Spaces the admin lost access to (SSE "member removed") stay in the list, their members and permissions are loaded again Previously the space disappeared from the admin list until a reload; the row would otherwise keep showing the admin as member and the actions based on the old permissions
The permissions of the selected spaces are loaded like in the files app, the batch actions show a spinner until they are loaded Needed by the Customize actions; the admin spaces page only requires Drives.List.all, so without Drives.ReadWriteEnabled.all disable, enable and delete depend on the user's permissions in the space
Deleted spaces are removed from the selection; the list switches to the new last page when the current one gets empty (based on the page count of usePagination) Previously done by the removed app.admin-settings.list.load handler, which also read the page size with a wrong default ('1') and thus hardly ever corrected the page
Customize submenu in the space context menu (edit subtitle, edit description, set image, set icon, delete image), replacing the single "Edit subtitle" entry Same menu as in the files app; the image/description actions show up for spaces the admin is a member of, like in the files app
Duplicate in the space batch actions It was only available in the admin context menu, the files app offers it as a batch action as well
The spaces list shows the space images (spinner while loading, icon fallback), loaded like in the files app's spaces table: fit processor, for the spaces on the current page, again on app.files.spaces.uploaded-image Space images were only visible in the files app; changes via Customize or the create dialog now show up immediately

Aligned with the files app

What changed Why
Footer text with plurals and "(including N disabled)" Same text as the spaces list of the files app
ResourceStatusIndicators instead of oc-status-indicators with own indicator loading Same component as the files app's spaces table
SpaceInfo as side bar header Same header as the files app's side bar
Side bar panels named and iconed like in the files app (no-selection, details-space, details-space-multiple, space-share), members panel hidden for disabled spaces Same panels in both apps (e2e step updated to space-share)
Row clicks use app.admin-settings.list.clicked.meta / .shift instead of app.resources.list.clicked.* (spaces, users, groups) Only the admin settings publishes and subscribes to them, the name now says so and can't collide with the files app's app.files.list.clicked.* events that web-pkg publishes
Selection count announced for screen readers in AppTemplate Like the app bar of the files app
Batch actions of all categories Previously only tertiary actions were shown, so e.g. "Duplicate" (secondary) was missing
sr-only page title (h1) in the app bar Screen readers get the page title like in the files app
The selection is kept when changing the page (spaces, groups) Same as the users list and the files app
The select all checkbox only considers the rows of the current page (spaces, users, groups) With the selection kept across pages it showed as checked on a page without any selected row (same number of selected items elsewhere) and couldn't be used there
Context menu sections named primary … quaternary Same names and DOM ids as the context menus of the files app
Files app: reloading a space image after it was set uses the fit processor Same processor as for the initial load, the spaces table showed differently processed images before
Removed dead code: unused avatarHeader slot, the write-only "last selected index" of the admin keyboard composables, the unused app.files.shiftAnchor.reset publish, the unused supportedLogoMimeTypes constant Dead code

Files app / web-pkg

What changed Why
Removed the route.name === 'admin-settings-spaces' special cases from rename, edit subtitle, disable, restore and delete, and the admin event from the quota modal Covered by the store now
Disabling a space also resets its reported usage in the store Previously only done for the admin copy
New SpaceImage component in web-pkg, used by the files app's spaces table and the admin spaces list; the image keeps its 24×24 size via max-w-none Same markup for the table image in both apps. The icon column is shrink, so with an image in every row the global img { max-width: 100% } collapsed the column and the images to 0×24 (only rows with the fixed-size fallback icon kept it open)
"Delete" comes after "Disable" in the space context menu and batch actions (files app and admin settings) Delete is the final, destructive step after disabling a space
Admin settings users: "Delete" is the last batch action and has its own context menu section after "Edit quota" Destructive actions come last, like for spaces and groups
Duplicate is only available for spaces the user is a member of, and reads the files of the space before creating the copy In the admin settings, duplicating a space the admin isn't a member of created a new, empty space and then failed with a 404 when reading the files (also on main via the context menu)

Related Issue

  • No related issue

How Has This Been Tested?

  • test environment: local, pnpm test:unit (web-pkg, web-app-files, web-app-admin-settings, web-runtime), pnpm check:types, pnpm lint, pnpm format:check; every commit passes the unit tests and the type check on its own
  • test case 1: new unit tests for the spaces store (allProjectSpaces, separate space objects, keeping spaces the user lost access to, permissions of non-member spaces and of spaces whose other copy has them already, retry after a failed permission request), the SSE "member removed" handler, SpaceImage, the image loading of the admin spaces list and the admin Spaces view (reload of spaces without members incl. outdated responses, reload after losing access, permission loading, selection cleanup)
  • test case 2: manual testing in the browser as admin:
    • admin spaces list shows all spaces; navigating to the files app within the same page still only lists the user's own spaces there
    • rename, edit quota, disable, enable, delete and edit subtitle update the admin list without a reload; managers stay visible after enabling
    • a space created via the "New" button shows its manager and members immediately, also with members added in the create dialog; disabling/enabling keeps them
    • Customize submenu: all entries for spaces the admin is a member of, only "Edit subtitle" otherwise (like the files app); set image, set icon and delete image update the list immediately; edit description opens the readme in the editor and closing it returns to the admin list
    • space images use processor=fit 64×64 like the files app's spaces table
  • test case 3: full exploratory test of the admin spaces page in the browser:
    • create via "New" with subtitle, image, quota and a member, and without options: manager, members, quota and image are shown immediately
    • search incl. empty state and "matching" footer, sorting by every sortable column (both directions, values checked), pagination
    • selection via click, checkbox, select all, Shift/Meta click, arrow keys, Shift+arrows, Space, Ctrl+A, Esc; selection kept across pages; selection announcement for screen readers
    • context menu via button and right click: rename (incl. empty name validation), duplicate, edit quota, disable, enable, delete, details; Customize: edit subtitle, set icon, delete image (all entries for spaces the admin is a member of, only "Edit subtitle" otherwise)
    • batch actions for two spaces: edit quota, disable, enable, delete; the page switches to the new last page after deleting the spaces of the last page
    • side bar: no selection, single space (SpaceInfo header, details, members panel incl. search), members panel hidden for disabled spaces, multiple selection
    • phone width: reduced columns, no horizontal scrolling
  • test case 4: Playwright, two sessions (admin and alan):
    • admin opens a space in the files app, then selects it in the admin settings without reloading: the batch actions show up, no endless spinner
    • alan adds admin as manager of a space: it shows up in the admin's files app; alan removes admin: it disappears from the files app but stays in the admin settings with alan as the only member
    • same with the admin settings open and the space selected: the space and the selection stay, members and permissions are loaded again, no spinner
    • every listed space has an image: the images render at 24×24 in the admin spaces list and the files app's spaces table

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@github-project-automation github-project-automation Bot moved this to Qualification in OpenCloud Team Board Sep 30, 2026
@AlexAndBear AlexAndBear added the Type:Maintenance E.g. technical debt, packaging, etc. label Sep 30, 2026

@JammingBen JammingBen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Noticed 2 small bugs:

  • Open a space in the files app, then go to the admin settings and select the same space -> endless loading spinner in the batch actions.
  • A SSE "member removed" event removes a space from the list in the admin-settings. It then re-appears after page reload.

@AlexAndBear
AlexAndBear requested a review from JammingBen October 1, 2026 06:29
@AlexAndBear

Copy link
Copy Markdown
Member Author

Noticed 2 small bugs:

  • Open a space in the files app, then go to the admin settings and select the same space -> endless loading spinner in the batch actions.
  • A SSE "member removed" event removes a space from the list in the admin-settings. It then re-appears after page reload.

thanks, should be fixed

@AlexAndBear
AlexAndBear merged commit d49e95f into main Oct 1, 2026
31 checks passed
@AlexAndBear
AlexAndBear deleted the feat/admin-settings-spaces-store-and-images branch October 1, 2026 07:14
@openclouders openclouders mentioned this pull request Oct 1, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Enhancement Type:Maintenance E.g. technical debt, packaging, etc.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants