feat(app): unify composer attachments with pill + lightbox redesign

Images and GitHub issues/PRs now live in one draft-store list (ComposerAttachment union) with cwd persisted on the draft. Paperclip becomes a + drop-up menu; queue button removed. Each pill uses a shared AttachmentPill wrapper with a corner-X that mirrors the auto-update toast spec. Pill body opens the attachment: GitHub via openExternalUrl, images via a new fullscreen AttachmentLightbox. GitHub picker auto-closes on select.
This commit is contained in:
Mohamed Boudra
2026-04-17 11:36:08 +07:00
parent 11524dc349
commit 3838a8b969
25 changed files with 2994 additions and 735 deletions
@@ -208,6 +208,7 @@ function DraftAgentScreenContent({
agentId: draftAgentIdRef.current,
draftId: draftIdRef.current,
}),
initialCwd: resolvedWorkingDir ?? "",
composer: {
initialServerId: resolvedServerId ?? null,
initialValues,
@@ -850,7 +851,7 @@ function DraftAgentScreenContent({
labels: {},
};
},
createRequest: async ({ attempt, text, images }) => {
createRequest: async ({ attempt, text, images, attachments }) => {
const trimmedPath = workingDir.trim();
const resolvedWorkingDir =
isAttachWorktree && selectedWorktreePath ? selectedWorktreePath : trimmedPath;
@@ -896,6 +897,7 @@ function DraftAgentScreenContent({
initialPrompt: text,
clientMessageId: attempt.clientMessageId,
...(imagesData && imagesData.length > 0 ? { images: imagesData } : {}),
...(attachments && attachments.length > 0 ? { attachments } : {}),
git: gitOptions,
});
@@ -1201,8 +1203,9 @@ function DraftAgentScreenContent({
blurOnSubmit={true}
value={draftInput.text}
onChangeText={draftInput.setText}
images={draftInput.images}
onChangeImages={draftInput.setImages}
attachments={draftInput.attachments}
onChangeAttachments={draftInput.setAttachments}
cwd={draftInput.cwd}
clearDraft={draftInput.clear}
autoFocus={!isSubmitting}
onAddImages={handleAddImagesCallback}