Skip to content

desktop: identify attachments in remove button names #68220

Description

@paul-geoghegan

Description

In OpenCode Desktop on Linux, Orca announces an attachment’s remove button as “Remove attachment” without identifying the file. With multiple attachments, it is difficult to tell which one a button will remove.

Each button should identify its attachment, for example “Remove attachment: image.png”.

The composer is shared with the web UI, so a fix may affect both.

OpenCode version

Development checkout b4de2c70bb.

Steps to reproduce

  1. Open a session and attach two different files.
  2. With Orca running, use Tab to navigate to their remove buttons.

Operating System

Linux

Activity

  1. added
    area/desktop
    type/bug
    version/v2
    on Dec 4, 2026
  2. opencodejr commented on Dec 4, 2026

    @opencodejr
    Contributor

    Seen with a simulated model or a mock server, not a real provider; a maintainer should confirm.

    This still happens on the latest dev (eed42a3).

    I built Desktop from source on Linux, attached image.png and notes.txt in the composer, and read the remove buttons' accessible names. Both are exactly Remove attachment. Only the image and the file card next to them carry the file name:

    - img "image.png"
    - button "Remove attachment"
    - text: notes.txt TXT
    - button "Remove attachment"
    

    The recording, screenshot and script below show it. I used a simulated server and attached the files through the composer's file input, not the system file picker.

    Likely cause (not confirmed): ComposerAttachments in packages/app/src/composer/editor/editor.tsx puts one shared removeLabel (set at line 308) on every remove button (lines 877, 906 and 954). Comment and context-file chips probably have the same problem. Since this component is shared, the web UI is likely affected too.

    https://anoma.ly/team/github-bot/media/5c1edb6ec0c6c3606f7ac5a047071a3f183c07e0990870d4d1ef45270c6a83a6.mp4

    Screenshot

    Reproduction script (drive.ts)
    import { Effect } from "effect"
    import { defineScript } from "opencode-drive"
    
    // Attach two files in the Desktop composer and print the accessible names of their remove buttons.
    const png = Buffer.from(
      "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8DwHwAFBQIAX8jx0gAAAABJRU5ErkJggg==",
      "base64",
    )
    
    export default defineScript({
      launch: "gui",
      gui: { timeout: 600_000 },
      run: ({ gui }) =>
        Effect.gen(function* () {
          yield* Effect.promise(async () => {
            await gui.locator('[data-component="composer-editor"]').waitFor({ timeout: 300_000 })
            await gui.locator('input[type="file"]').first().setInputFiles([
              { name: "image.png", mimeType: "image/png", buffer: png },
              { name: "notes.txt", mimeType: "text/plain", buffer: Buffer.from("hello\n") },
            ])
            const strip = gui.locator('[data-component="composer-attachments"]')
            await strip.waitFor({ timeout: 30_000 })
            await gui.waitForTimeout(1500)
            const buttons = strip.locator("button")
            const count = await buttons.count()
            console.log(`remove buttons: ${count}`)
            for (let i = 0; i < count; i++) {
              console.log(`button ${i} aria-label: ${JSON.stringify(await buttons.nth(i).getAttribute("aria-label"))}`)
            }
            // What a screen reader gets: the accessibility tree of the attachment strip.
            console.log(await strip.ariaSnapshot())
            await buttons.first().focus()
            await gui.screenshot({ path: `${process.env.OPENCODE_DRIVE_MEDIA_DIR}/problem.png` })
          })
        }),
    })

    Run it with opencode-drive from an OpenCode checkout: opencode-drive start --dev <checkout> --script ./drive.ts. It drives OpenCode Desktop built from that checkout.

  3. added
    status/repro-simulated
    on Dec 4, 2026
  4. opencodejr commented on Dec 4, 2026

    @opencodejr
    Contributor

    I opened a pull request with a fix: #68227. A maintainer will review it.

  5. Olegoverman commented on Dec 5, 2026

    @Olegoverman

    Hi! I'm a junior QA/Automation developer looking to contribute. I can see this is an accessibility issue where the remove button is missing the attachment name in its accessible label. Is anyone currently assigned to this? If not, I'd love to submit a PR to fix the ARIA labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/desktopplatform/linuxstatus/repro-simulatedtype/bugversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions