Skip to content

move fetch logic and use from solid-logic - #220

Open
SharonStrats wants to merge 2 commits into
stagingfrom
feat/3-dots-menu
Open

move fetch logic and use from solid-logic#220
SharonStrats wants to merge 2 commits into
stagingfrom
feat/3-dots-menu

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.

Pull request overview

This PR refactors source-pane resource fetching by removing the local resourceLoader utilities and switching the UI components to call the solid-logic singleton for content/metadata retrieval.

Changes:

  • Removed src/resourceLoader.ts and updated components to use solidLogicSingleton.resource.* for fetching content and resource metadata.
  • Updated SourceProvider and SourceEditorCard to adapt to the new metadata shape/flow.
  • Removed test/helpers.test.js which previously validated response-header metadata extraction and fetch+metadata behavior.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
test/helpers.test.js Removes unit tests that covered metadata extraction and fetch+metadata behavior.
src/resourceLoader.ts Removes the in-repo fetch/metadata helper functions in favor of solid-logic.
src/components/source-provider/SourceProvider.ts Switches initial content+metadata loading to solidLogicSingleton.resource.fetchContentAndMetadata.
src/components/source-editor-card/SourceEditorCard.ts Switches post-save metadata refresh to solidLogicSingleton.resource.fetchResourceMetadata.
Suppressed comments (1)

src/components/source-editor-card/SourceEditorCard.ts:202

  • The nested try/catch around metadata refresh only rethrows the error and doesn’t add any handling; the outer try/catch already handles failures. Removing the inner block reduces indentation and makes the control flow clearer.
      try {
        const metadata = await solidLogicSingleton.resource.fetchResourceMetadata(saveSubject as any)
          sourceContext.updateMetadata({
            contentType: metadata.contentType,
            eTag: metadata.eTag
          })
        this._resetEditorState()
      } catch (err) {
        throw err
      }

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/source-provider/SourceProvider.ts
Comment thread src/components/source-editor-card/SourceEditorCard.ts Outdated
…istry@3.1.2-2 solid-ui@3.1.3-17) (latest: rdflib@2.4.0)
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