Skip to content

New layout playground - #330

Draft
SharonStrats wants to merge 6 commits into
stagingfrom
new-layout-playground
Draft

SharonStrats wants to merge 6 commits into
stagingfrom
new-layout-playground

Conversation

@SharonStrats

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 High severity · 1 Medium severity

Open (8)
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 thread src/types.ts
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)
}
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