Repository navigation
feat: #487 grabs are attachments — snapshot survives reload, cards in the transcript #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2cb4c81
refactor(grab): #487 carry the dom preview as markup instead of a liv…
omridevk c3040eb
feat(drafts): #487 persist composer attachments in the session draft row
omridevk 6bd3f53
feat(grab): #487 grab attachment payload codec and sourceLabel move
omridevk efacef2
feat(page): #487 refit oversized image previews to the payload budget
omridevk 72f9025
feat(page): #487 sandboxed grab snapshot frame
omridevk 744d699
feat(page): #487 grab attachment card and registration
omridevk 9685e1e
feat(page): #487 expand grab attachments into grounding text
omridevk 3404f22
feat(ui-kit-chat): #487 atomic composer attachment replace with stabl…
omridevk 89d49ba
feat(conciv): #487 grab staging module over composer attachments
omridevk beb21b1
feat(conciv): #487 stage grabs as attachments and delete the grab store
omridevk b6cfc00
test(conciv): #487 prove a staged grab survives a panel reload
omridevk 204b443
fix(page): #487 scale the grab snapshot to fit its card
omridevk bcfb285
fix(page): #487 paint the snapshot frame on the card's own surface
omridevk 05aa193
fix(ui-kit-chat): #487 no empty user bubble for an attachment-only me…
omridevk 8dcebf9
fix(ui-kit-chat): #487 a model-only text part is not visible text
omridevk e6520a4
refactor(drafts): #487 remove the grabs channel now that grabs are at…
omridevk aee75f9
fix(page): #487 correct fallback font metrics with capture-time lette…
omridevk e7435d3
fix(conciv): #487 invalidate a grab placement the composer no longer …
omridevk ddf1672
fix(grab): #487 bound the grab payload at its boundaries
omridevk 6bcbf08
fix(page): #487 capture svg grabs and batch the metric probes
omridevk ee547ab
fix(ui-kit-chat): #487 give document attachments collision-resistant ids
omridevk 81d98ac
fix(conciv): #487 register the page extension in the standalone entry
omridevk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@conciv/embed': patch | ||
| --- | ||
|
|
||
| Grabs are attachments: the snapshot survives a panel reload, sent grabs render as a card in the transcript instead of raw HTML text, and composer attachments now persist in the session draft. |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import type {AnyExtension} from '@conciv/extension' | ||
| import type {ExtensionInstance} from './extension-slots.js' | ||
|
|
||
| export function createInstances(extensions: AnyExtension[]): ExtensionInstance[] { | ||
| return extensions.flatMap((extension) => { | ||
| try { | ||
| const result = extension.__client?.() | ||
| return [ | ||
| { | ||
| extension, | ||
| clientValue: result?.value ?? {}, | ||
| effects: result?.effects ?? [], | ||
| dispose: result?.dispose ?? (() => {}), | ||
| }, | ||
| ] | ||
| } catch (error) { | ||
| console.error(`[conciv] extension "${extension.name}" failed to mount`, error) | ||
| return [] | ||
| } | ||
| }) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,17 @@ | ||
| import type {GrabApi, GrabProvider} from '@conciv/grab' | ||
| import {grabApi as pageGrabApi} from '@conciv/page' | ||
| import type {PaneGrabStore} from '../app/pane-context.js' | ||
| import type {GrabStaging} from '../pane/grab-staging.js' | ||
|
|
||
| export function makePaneGrabApi(store: PaneGrabStore, provider?: GrabProvider): GrabApi { | ||
| export function makePaneGrabApi(staging: GrabStaging, provider?: GrabProvider): GrabApi { | ||
| const actions = provider?.() ?? pageGrabApi | ||
| return { | ||
| pick: actions.pick, | ||
| comment: actions.comment, | ||
| cancel: actions.cancel, | ||
| isActive: actions.isActive, | ||
| grabbable: actions.grabbable, | ||
| stage: store.stage, | ||
| staged: () => store.grabs().flatMap((entry) => ('preview' in entry ? [entry] : [])), | ||
| clear: store.clear, | ||
| stage: staging.stage, | ||
| staged: staging.staged, | ||
| clear: staging.clear, | ||
| } | ||
| } |
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in ee547ab, by making the ids collision-resistant rather than regenerating on restore.
You are right that the existing regression test cannot catch this — it remounts within one page, so the module-level counter never resets.
createDocumentAttachmentAdapternow uses theattachmentId()helper that the primitive adapters inattachment-adapter.tsalready share (crypto.randomUUID()with a counter fallback for non-secure contexts), so a restoreddocument-<uuid>cannot collide with a freshly staged one.Regenerating on restore was the alternative; reusing the existing helper fixes it for every document adapter rather than only the grab path, and keeps one id scheme in the package.