跳到主内容

dsh-client-ui-attachment/packages/client/ui-attachment官方

175.3kStar19.0kFork0Issue752Watching

等待 conversation 包的附件声明,注册草稿图片轨道、消息图片画廊和原图灯箱等纯展示组件,为会话 UI 渲染附件状态

机审证据3/5方法论数据来源安装命令持续维护DSH 版本风险扫描
机审证据安装命令仓库已核验dsh-plugin Topic许可证READMEAI 百科

ⓘ 此插件是大仓库 deepseek-ai/deepseek-harness 的子包,星数与活跃度统计的是整个仓库。

语言
TypeScript
License
MIT
分支
master
ai-agentscordisdshdsh-plugin

安装

命令web profile
$ dsh plugin --profile web add npm:@deepseek-ai/dsh-client-ui-attachment

在终端中运行以上命令,通过 dsh CLI 安装此插件。可在右上角切换 Profile。 第一次用 dsh?看这篇新手教程

对话式安装

帮我安装 DeepSeek Harness 插件 deepseek-ai/deepseek-harness/packages/client/ui-attachment:先查看仓库 https://github.com/deepseek-ai/deepseek-harness 确认安全性,然后执行安装命令并验证插件加载成功。

把这段指令粘贴给 DSH Web GUI 里的助手,由它代你完成安装与验证。

English | 中文

Dynamic attachment presentation plugin for the conversation UI. It waits for the conversation package's conversation.input.attachments and conversation.message.images declarations through ctx.slots.inject, then registers the composer draft-image rail, document drop target, chat-history image gallery, and original-image lightbox. The conversation slot owner supplies attachment data, image loading, callbacks, and its namespace translator; presentation components remain pure props and are not exported from the package entry.

Attachment rail

AttachmentRail renders pending draft images as fixed 64px thumbnails (16px radius) in one horizontally scrolling row whose scrollbar stays hidden. Overflow is announced by circular edge arrows instead: each pages one viewport (minus one card of context, floored at 200px) with smooth scrolling (instant under prefers-reduced-motion: reduce), and arrow visibility is recomputed from scroll geometry on scroll, item-count changes, and rail size changes (a ResizeObserver on the rail element, so sidebar and panel resizes count, not only window resizes). The rail scrolls horizontally only: a non-passive listener consumes every wheel tick with a vertical component — nothing scrolls the conversation behind the composer — converting a pure vertical wheel to a horizontal step (LINE/PAGE deltas normalized to pixels, per-tick travel clamped to 60px) and keeping a diagonal pan's horizontal intent, while purely horizontal pans stay native. A newly added item is revealed at the rail's end; removal keeps the scroll position, and a rail that mounts over an already-populated draft keeps its start position. Each thumbnail opens its original through onOpen on a single click, and its remove control sits inside the card's top-right corner, hidden until the card is hovered or the control keyboard-focused; coarse-pointer (touch) surfaces show it permanently because they have no hover. The owner decides mounting and renders the rail only while items exist.

Message images and the lightbox

MessageImage renders one durable history image, loading a session-authorized URL through the owner's ImageLoader; a failed load renders an explicit retry control, and a settled load answers a single click by opening ImageLightbox (clicks during loading are ignored). Sizing follows DeepSeek Chat: a message's lone image (variant="single") renders at 240px on its longer edge with the displayed aspect ratio clamped to [0.25, 4] — the overflow is cropped by object-fit: cover, anchored to the top of very tall images and the left of very wide ones — and never upscales past its natural size; an image among several (variant="tile") is a fixed 64px square. ImageGallery wraps a message's images in one aligned wrapping flex group (end for user messages, start for assistant messages), picks the variant from the image count, and renders nothing for an empty list. ImageLightbox is a document-level modal preview over the shared dialog mask (--dsw-alias-bg-mask-1 + --dsw-mask-blur, painted on its own layer so the blur never touches the previewed image) that closes on Escape, a mask press, or its close control, and restores focus to its opener on unmount.

Drop overlay

DropOverlay is the full-viewport invitation shown while a file drag is over the page: illustration, title, and a limits line while drops are accepted (disabled swaps the blocked illustration and hides the limits line). The layer is pointer-inert — the owner's document-level drag listeners keep the enter/leave count and decide accept/reject; the overlay only shows state. It portals to the body like the lightbox.

Model Experience

None, as the plugin only renders attachment state supplied by the conversation UI and contributes no model-visible input.

KV Cache effect

None; this package neither assembles nor sends a provider request.

Known Limitations and Deferred Work

  • Images only — non-image files have no rail card or history renderer yet; DeepSeek Chat-style file cards and upload-progress states wait until the composer accepts non-image attachments.
  • No zoom or download in the lightbox — the preview renders the original at fit-to-viewport size only.
  • The lightbox does not trap focus — it sets aria-modal and restores focus on close, but Tab can reach the page behind it.

查看使用指南 →

该插件的安装步骤、关键要点、FAQ 与兼容性说明(基于已收录字段派生)。

收录徽章

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/deepseek-ai/deepseek-harness/packages/client/ui-attachment)

把这段 markdown 粘贴到你的 GitHub README,链接回本插件详情页。徽章只声明已被本站收录,不代表安全认证。

返回插件目录