New layout playground - #330
Draft
SharonStrats wants to merge 6 commits into
Draft
SharonStrats wants to merge 6 commits into
SharonStrats wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical issues remain in authentication, ACL enforcement, cache isolation, Trash creation, type-index cleanup, and outdated tests/fixtures.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 7
Open (8)
Update factory callers and fixtures for the new signature · New Guard fetch operations against stale session identity · New Key metadata cache by user identity · New Abort moves when Trash container ACL setup fails · New Update metadata tests for the new canControl field · New Add setACLUserOwnerOnly to ACL test fixtures · New Update resource logic construction calls for the new signature · New Handle HTTP 404 responses before creating missing Trash containers · New
What changed in this PR
Adds layout-playground support for resource metadata, Trash moves, ACLs, type indexes, and file operations.
Changes:
- Expands resource and container APIs.
- Adds authenticated copy, move, and Trash handling.
- Updates ACLs, type indexes, tests, declarations, and dependencies.
| File | Description |
|---|---|
test/resourceLogic.test.ts |
Updates resource-operation mocks and fixtures. |
test/resource/resourceLogic.test.ts |
Adds move-to-Trash coverage and mocks. |
src/util/containerLogic.ts |
Adds visibility and layout helpers. |
src/types.ts |
Expands resource and type-index interfaces. |
src/typeIndex/typeIndexLogic.ts |
Adds scoped registration helpers. |
src/solid-file-client.d.ts |
Declares the file-client dependency. |
src/resource/resourceMetadata.ts |
Adds control-access parsing. |
src/resource/resourceLogic.ts |
Implements caching, file operations, Trash moves, and index handling. |
src/logic/solidLogic.ts |
Wires new resource dependencies. |
src/acl/aclLogic.ts |
Adds owner-only ACL support. |
package.json |
Updates build scripts and dependencies. |
package-lock.json |
Refreshes dependency resolution. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| import { type AclLogic, type ResourceAccess, type ResourceAccessWithDelete, type ResourceDeleteOptions, type ResourceLogic, type ResourceMetadata, type ResourceMetadataWithDelete, type TypeIndexLogic } from '../types' | ||
| import { type AclLogic, type AuthnLogic, type ProfileLogic, type ResourceAccess, type ResourceDeleteOptions, type ResourceLogic, type ResourceMetadata, type TypeIndexLogic, type TypeIndexScope, type TypeIndexVisibility } from '../types' | ||
|
|
||
| export function createResourceLogic(store, authn: AuthnLogic, aclLogic: AclLogic, containerLogic, typeIndexLogic: TypeIndexLogic, profileLogic: ProfileLogic): ResourceLogic { |
Comment on lines
+12
to
+18
| const sessionAny = authn.authSession as any | ||
| const authAdapter = { | ||
| fetch: (typeof sessionAny.fetch === 'function' | ||
| ? sessionAny.fetch.bind(sessionAny) | ||
| : typeof sessionAny.authFetch === 'function' | ||
| ? sessionAny.authFetch.bind(sessionAny) | ||
| : globalThis.fetch.bind(globalThis)) |
Comment on lines
+206
to
+208
| const cachedMetadata = metadataCache.get(subject.uri) | ||
| if (cachedMetadata) { | ||
| return cachedMetadata |
Comment on lines
+307
to
+309
| } catch (error) { | ||
| // Add error handling | ||
| } |
| export function readWacAccessInfo (wacAllow: string | null | undefined) { | ||
| if (!wacAllow) { | ||
| return { canEdit: false, isPublic: false } | ||
| return { canEdit: false, canControl: false, isPublic: false } |
Comment on lines
+89
to
+93
| setACLUserOwnerOnly: (docURI: string, me: NamedNode, | ||
| options: { | ||
| defaultForNew?: boolean, | ||
| } | ||
| ) => Promise<NamedNode>, |
| createContainer: ReturnType<typeof vi.fn> | ||
| isContainer: ReturnType<typeof vi.fn> | ||
| getContainerMemberCount: ReturnType<typeof vi.fn> | ||
| getContainerVisibleItemCount: ReturnType<typeof vi.fn> |
Comment on lines
+298
to
+302
| try { | ||
| await store.fetcher.webOperation('HEAD', trashContainer.uri) | ||
| } catch (_error) { | ||
| await createContainer(trashContainer.uri) | ||
| } |
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.


No description provided.