Skip to content

Canonicalize attached and referenced file preview and download behavior #2697

Closed

Description

@jonolee-kr

The workflow

A user needs to open or download the same file from several BB surfaces:

  1. Attach a non-image file to a chat message.
  2. Reference a workspace or thread-storage file in chat.
  3. Select a file mention.
  4. Open a Markdown file that links to sibling files or embeds sibling assets.
  5. Use the same workflow in web, desktop, mobile, root compose, thread detail, and Tasks.

The file should keep one identity and provide predictable Open and Download actions.

What happens today

Current main uses different routing and action policies for each surface.

  • Chat project files use raw project-attachment anchors with target=_blank. The browser or shell decides what happens.
  • Absolute local files can use an in-app resolver. Other unresolved file paths render as inert controls.
  • Thread detail routes local Markdown links for workspace, host, and thread-storage previews.
  • Root compose passes no Markdown routing to workspace, project, host, or thread-storage previews.
  • Sidebar Markdown previews do not route embedded relative assets from the source file directory.
  • Project attachments, workspace files, host files, thread storage, and Tasks attachments use separate URL and header contracts.
  • Tasks forces downloads for non-raster attachments while chat raw routes have no shared disposition contract.
  • Missing context can turn an active-looking file control into an inert element.
  • Desktop new-window handling can move an internal file URL into the operating-system browser.
  • The mobile WebView shell reuses the web renderer, but target=_blank handling is not explicit.

Static evidence on main at 3414fda:

PR #2689 partially overlaps this request. It adds PDF-specific download selection and attachment disposition for workspace, host, and thread-storage routes.

PR #2579 fixes durable prompt image persistence. It does not cover non-image file actions.

What you would expect

Define one canonical file reference with:

  • Source kind.
  • Owner identifier.
  • Path or attachment identifier.
  • Display name.
  • MIME type.
  • Byte size.
  • Optional line or fragment target.

Use one resolver for chat attachments, file mentions, Markdown links, inline-code references, sidebar files, and Tasks attachments.

Every byte-backed file should provide:

  • Open in BB when the type is previewable.
  • Download with an explicit attachment disposition and safe filename.
  • A clear missing, unauthorized, disconnected, unsupported, oversized, or missing-context state.

Preview and download must use separate route semantics.

All relative Markdown links and embedded assets must resolve from the source file directory.

Desktop and mobile shells must keep session-bound BB URLs inside an authenticated BB context.

Context and alternatives

The source audit covered installed BB 0.40.0 behavior and current main architecture.

I did not run every client during this issue filing. Runtime outcomes remain unverified where the evidence above states shell or browser behavior.

I searched open and closed issues and pull requests. I found partial efforts, but no issue or pull request for the complete cross-client contract.

A safe implementation can reuse PR #2689 for download headers and file-download utilities, then cover the remaining stores and surfaces without duplicating its PDF work.

AGENT GENERATED

Activity

  1. added
    ui
    threads
    tasks
    on Aug 29, 2026
  2. bb-slop-cop commented on Aug 29, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Type: Feature
    • Priority: Medium
    • Effort: High
    • Labels: ui, threads, tasks

    No pull request was safe because the final Type is not Bug.

  3. jonolee-kr commented on Oct 12, 2026

    @jonolee-kr
    ContributorAuthor

    Sufficiently resolved by #4554

  4. ariofrio commented on Oct 16, 2026

    @ariofrio
    Contributor

    Previewable files still lack a Download action after #4554. Tracked separately in #5620.

    Reproduced: web UI, Chrome on macOS 26.5.1, npm server 0.46.1-ariofrio.7. Current upstream main at 01affc197dc621cddc7343e09b1c5c10a5b9efcb has the same action gap by source inspection; I did not run that commit.

    1. Open a thread with a workspace containing README.md and package.json.
    2. Open the right panel → Open new tab → search for and open README.md.
    3. Open File actions, then repeat with package.json.

    Actual: Markdown offers “Copy file path”, “Copy markdown”, and “Refresh file”; JSON offers “Copy file path”, “Copy file contents”, “Refresh file”, and “Wrap lines”. Neither offers Download.

    Expected: save the original file to the client computer, including when its workspace is on another machine.

    Source: UnsupportedFilePreview renders Download; the shared file-actions menu does not. This follow-up concerns previewable files, rather than the unsupported-file download supplied by #4554.

    Screenshot captured locally; the CLI refused its upload: attaching files requires write access to the repository.

    Investigation: BB thread (private).

    Written by Codex

    AGENT GENERATED

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

    tasksthreadsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions