Compare commits

..
Author SHA1 Message Date
usrnk1 22160508ee fix(desktop): refine composer dropzone 2026-08-13 15:14:36 +02:00
usrnk1 12fcc75201 feat(desktop): update composer dropzone 2026-08-13 14:16:49 +02:00
4 changed files with 41 additions and 25 deletions
@@ -48,12 +48,20 @@ export function PromptInputV2Composer(props: PromptInputV2ComposerProps) {
const dialog = useDialog()
const command = useCommand()
const language = useLanguage()
const dropLabel = createMemo(() => {
const input = props.controller.model.selection.current()?.capabilities.input
if (!input?.image && !input?.pdf) return language.t("ui.promptInput.dropFiles")
if (!input.pdf) return language.t("ui.promptInput.dropFiles.image")
if (!input.image) return language.t("ui.promptInput.dropFiles.pdf")
return language.t("ui.promptInput.dropFiles.imagePdf")
})
return (
<div class="flex flex-col gap-3">
<PromptInputV2
controller={props.controller}
borderUnderlay={props.borderUnderlay}
dropLabel={dropLabel()}
class={props.class}
variantControlVisible={!props.controller.model.loading}
attachKeybind={command.keybindParts("file.attach")}
@@ -39,6 +39,7 @@ export type PromptInputV2Props = {
disabled?: boolean
readOnly?: boolean
borderUnderlay?: boolean
dropLabel?: string
class?: string
modelControl?: JSX.Element
variantControlVisible?: boolean
@@ -109,11 +110,10 @@ export function PromptInputV2(props: PromptInputV2Props) {
</Show>
<form
data-component="prompt-input-v2"
data-dock-border-underlay={props.borderUnderlay ? "v2" : undefined}
data-dock-border-underlay={props.borderUnderlay && state.drag !== "active" ? "v2" : undefined}
class="group/prompt-input relative min-h-[96px] w-full overflow-clip rounded-xl bg-v2-background-bg-base"
classList={{
"shadow-[var(--v2-elevation-raised)]": !props.borderUnderlay,
"border border-v2-icon-icon-info border-dashed": state.drag === "active",
"shadow-[var(--v2-elevation-raised)]": !props.borderUnderlay && state.drag !== "active",
}}
onSubmit={(event) => {
event.preventDefault()
@@ -125,8 +125,22 @@ export function PromptInputV2(props: PromptInputV2Props) {
onDrop={props.controller.onDrop}
>
<Show when={state.drag === "active"}>
<div class="pointer-events-none absolute inset-0 z-20 grid place-items-center rounded-xl bg-v2-background-bg-base/90 text-v2-text-text-base">
{i18n.t("ui.promptInput.dropFiles")}
<div class="pointer-events-none absolute inset-0 z-20 grid place-items-center rounded-xl bg-[color-mix(in_srgb,var(--v2-background-bg-accent)_5%,var(--v2-background-bg-base))] text-v2-text-text-muted">
<svg class="absolute inset-0 size-full" aria-hidden="true">
<rect
x="0.25"
y="0.25"
width="calc(100% - 0.5px)"
height="calc(100% - 0.5px)"
rx="11.75"
fill="none"
stroke="var(--v2-border-border-focus)"
stroke-width="0.5"
stroke-dasharray="3 3"
stroke-dashoffset="1.5"
/>
</svg>
{props.dropLabel ?? i18n.t("ui.promptInput.dropFiles")}
</div>
</Show>
+4 -1
View File
@@ -124,7 +124,10 @@ export const dict: Record<string, string> = {
"ui.promptInput.noMatchingItems": "No matching items",
"ui.promptInput.commands": "Commands",
"ui.promptInput.dropFiles": "Drop files to attach",
"ui.promptInput.dropFiles": "Drop files to add",
"ui.promptInput.dropFiles.image": "Drop images or files to add",
"ui.promptInput.dropFiles.pdf": "Drop PDFs or files to add",
"ui.promptInput.dropFiles.imagePdf": "Drop images, PDFs, or files to add",
"ui.promptInput.removeAttachment": "Remove attachment",
"ui.promptInput.label": "Prompt",
"ui.promptInput.placeholder.shell": "Enter shell command...",
+10 -19
View File
@@ -15,29 +15,20 @@ description: "Get started with OpenCode."
## Install
<CodeGroup>
### Install script
```bash npm
npm install -g @opencode-ai/cli@next
```
```bash bun
bun install -g --trust @opencode-ai/cli@next
```
```bash pnpm
pnpm add -g --allow-build=@opencode-ai/cli @opencode-ai/cli@next
```
```bash yarn
yarn global add @opencode-ai/cli@next
```
```bash curl
```bash
curl -fsSL https://raw.githubusercontent.com/anomalyco/opencode/v2/install | bash
```
</CodeGroup>
You can also install it with the following package managers.
<Tabs>
<Tab title="npm">```bash npm install -g @opencode-ai/cli@next ```</Tab>
<Tab title="bun">```bash bun install -g --trust @opencode-ai/cli@next ```</Tab>
<Tab title="pnpm">```bash pnpm add -g --allow-build=@opencode-ai/cli @opencode-ai/cli@next ```</Tab>
<Tab title="Yarn">```bash yarn global add @opencode-ai/cli@next ```</Tab>
</Tabs>
The package uses a trusted postinstall script to select the native `opencode2` binary for your platform. The Bun and pnpm
commands above explicitly allow that script to run.