add Slack-friendly agent downloads - #74
Conversation
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
REQUEST_CHANGES: the exact three-dot comparison has one blocking localization regression and one non-blocking never-completes risk in ZIP generation. Supplied GitHub evidence was inspected: four checks had succeeded and three were still in progress at capture time; required checks independently govern merge readiness.
Deterministic publication result: 1 blocking and 1 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
APPROVE: fresh review of the exact three-dot comparison found no publishable findings. The earlier localization and stalled-worker issues are fixed in the current comparison, and both supplied threads are resolved. Final self-check covered PNG, ZIP, and Markdown export flows; accessibility and localization; navigation and consent boundaries; async error, timeout, cancellation, lifecycle, and race behavior; test honesty; design-system rules; duplicate overlap; and blocking-evidence quality. Supplied GitHub evidence was inspected: Frontend checks and unit tests, Linux/macOS Rust checks, clean-room install, and DCO had succeeded, while transcript virtualization, frontend build smoke, and Windows Rust checks were still in progress at capture time; required checks independently govern merge readiness.
Deterministic publication result: 0 blocking and 0 non-blocking finding(s) publishable; 0 duplicate(s) suppressed.
Pending checks: 1 check(s) are not complete.
This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.
Category: improvement
User Impact: Users can download agent cards as ZIP files that preserve portable agent data when shared through Slack.
Problem: Slack can process uploaded PNGs as images and strip the metadata Berd uses to carry an agent’s instructions and settings. The existing separate PNG and Markdown actions also made the available export formats harder to scan.
Solution: Combine agent exports into a split download control with PNG as the default, plus ZIP and Markdown options. ZIP creation runs off the renderer thread, preserves the original portable PNG without recompression, and includes cancellation and accessible progress handling.
File changes
package.json
Adds
fflateas a direct dependency for standards-compatible ZIP creation.pnpm-lock.yaml
Records the new direct dependency without unrelated platform metadata changes.
src/features/agents/ui/share-card/AgentShareDialog.tsx
Combines PNG, ZIP, and Markdown exports into one split download control. Adds worker lifecycle management, operation ownership, cancellation, loading feedback, and modal-safe menu behavior.
src/features/agents/ui/share-card/AgentShareDialog.test.tsx
Covers ZIP downloads, worker errors and cancellation, duplicate prevention, pending announcements, and existing portable-card behavior.
src/features/agents/ui/share-card/agentZip.ts
Defines the shared stored-ZIP encoder so the already-compressed PNG is not recompressed.
src/features/agents/ui/share-card/agentZip.test.ts
Verifies the archive contains the expected portable PNG filename and bytes.
src/features/agents/ui/share-card/agentZip.worker.ts
Runs ZIP assembly in a dedicated worker to keep the renderer responsive.
src/features/design-system/ui/designSystemSections.ts
Marks Split Button as an actively used shared component in explorer navigation.
src/shared/i18n/locales/en/agents.json
Updates the share-dialog description and export-option labels.
src/shared/ui/dropdown-menu.tsx
Adds an opt-in modal layer for portaled dropdown content.
src/shared/ui/split-button.tsx
Supports Button loading feedback and modal-layer forwarding for menus and tooltips.
src/shared/ui/tooltip.tsx
Adds an opt-in modal layer so portaled tooltip content remains above dialog chrome.
Verification
pnpm vitest run src/features/agents/ui/share-card/AgentShareDialog.test.tsx src/features/agents/ui/share-card/agentZip.test.tsjust checkpnpm build