Skip to content

Conversation

@lukemelia
Copy link
Contributor

@lukemelia lukemelia commented Jan 20, 2026

Screen.Recording.2026-01-20.at.7.50.42.PM.mov

@github-actions
Copy link

Preview deployments

@github-actions
Copy link

github-actions bot commented Jan 20, 2026

Host Test Results

    1 files  ±0      1 suites  ±0   1h 38m 23s ⏱️ - 2m 8s
1 900 tests +3  1 881 ✅ +1  17 💤 ±0  0 ❌ ±0  2 🔥 +2 
1 915 runs  +3  1 894 ✅  - 1  17 💤 ±0  2 ❌ +2  2 🔥 +2 

For more details on these errors, see this check.

Results for commit 3e9b246. ± Comparison against base commit 500df53.

This pull request removes 2 and adds 5 tests. Note that renamed tests count towards both.
Chrome ‑ Integration | card-basics > cards allowed to be edited: linksTo FileDef renders without editor controls in edit format
Chrome ‑ Integration | card-basics > cards allowed to be edited: linksToMany FileDef renders without editor controls in edit format
Chrome ‑ Acceptance | interact submode tests > 1 stack: can link a file via the chooser and index the update
Chrome ‑ Integration | Store: getFileMeta loads file meta for executable files
Chrome ‑ Integration | card-basics > cards allowed to be edited: linksTo FileDef renders editor controls in edit format
Chrome ‑ Integration | card-basics > cards allowed to be edited: linksToMany FileDef renders editor controls in edit format
Chrome ‑ Integration | realm: realm can delete a file asset via card source

♻️ This comment has been updated with latest results.

@lukemelia lukemelia force-pushed the cs-8391-deal-with-new-case-upload-ui-needs-to-plugin-where-card branch 3 times, most recently from 07b9eb7 to e8c540e Compare January 21, 2026 04:46
@habdelra habdelra requested a review from Copilot January 21, 2026 14:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enables users to choose files for linksTo(FileDef) fields through a file chooser modal interface, treating FileDef fields with the same editor controls as regular card fields.

Changes:

  • Added getFileMeta method to the Store interface and service to load file metadata
  • Enabled editor controls for linksTo(FileDef) and linksToMany(FileDef) fields in edit format
  • Simplified realm routing patterns and removed restrictive checks that prevented file operations

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/runtime-common/realm.ts Simplified DELETE route pattern and removed checks that prevented file metadata operations on .json files
packages/runtime-common/index.ts Added getFileMeta method to Store interface for loading file metadata
packages/runtime-common/error.ts Fixed isCardErrorJSONAPI to return proper boolean instead of truthy value
packages/host/tests/integration/store-test.gts Added test for getFileMeta method
packages/host/tests/integration/realm-test.gts Added test for deleting file assets via card source
packages/host/tests/integration/components/card-basics-test.gts Updated tests to verify FileDef fields now show editor controls
packages/host/tests/helpers/interact-submode-setup.gts Changed test fixtures from .txt to .md files and FileDef to MarkdownDef
packages/host/tests/acceptance/interact-submode-test.gts Added comprehensive test for file linking via chooser modal
packages/host/app/services/store.ts Implemented getFileMeta method to load file metadata documents
packages/host/app/components/operator-mode/choose-file-modal.gts Changed from creating synthetic FileDef to loading actual file metadata
packages/base/links-to-many-component.gts Removed isFileDef parameter from shouldRenderEditor to enable editor controls
packages/base/links-to-editor.gts Added file chooser integration for FileDef fields
packages/base/card-api.gts Removed isFileDef parameter from shouldRenderEditor to enable editor controls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +80 to 84
throw new Error(
`choose-file-modal: failed to load file meta for ${fileURL.href}`,
);
}
this.deferred.fulfill(file);
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The error thrown here will result in an uncaught promise rejection if the user clicks the Add button while a file is selected but the file metadata fails to load. Consider handling this error more gracefully, such as displaying an error message to the user rather than throwing an uncaught exception.

Suggested change
throw new Error(
`choose-file-modal: failed to load file meta for ${fileURL.href}`,
);
}
this.deferred.fulfill(file);
console.error(
`choose-file-modal: failed to load file meta for ${fileURL.href}`,
);
// Treat this as if no file was chosen so callers receive `undefined`.
this.deferred.fulfill(undefined as unknown as FileDef);
} else {
this.deferred.fulfill(file);
}

Copilot uses AI. Check for mistakes.
- Improves cache invalidation when linked-to files haven't been indexed yet
@lukemelia lukemelia force-pushed the cs-8391-deal-with-new-case-upload-ui-needs-to-plugin-where-card branch from e8c540e to 3e9b246 Compare January 21, 2026 19:33
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