block / block/berd

Files panel opens Markdown externally instead of in the artifact viewer

Open Beginner friendly
#171 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
909
Forks
116
Avg merge
1d 1h
Merged PRs (30d)
156

Description

## Before filing

- [x] I searched open and closed issues for duplicates.
- [x] I reproduced this on the latest release.
- [x] This report covers one bug.

## Closest existing issue

None found.

## What's broken

Clicking a Markdown file in a chat's right-rail **Files** tab always delegates to macOS. It opens the registered external editor even though Berd already supports Markdown in its in-app artifact viewer.

## Steps to reproduce

1. Launch Berd v0.6.2 on macOS Apple Silicon.
2. Open a chat with a project or workspace attached. No agent turn is required.
3. Open the right rail's **Files** tab.
4. Click `README.md`.

## Expected behavior

`README.md` opens in Berd's sidebar artifact viewer.

## Actual behavior

macOS opens `README.md` in the registered external editor. On this machine, that editor is Xcode.

## Frequency

Every time. The path is deterministic.

## Version

Berd v0.6.2, the latest release as of 2026-08-22.

## Operating system

macOS 15.7.1 on Apple Silicon.

## Model or provider

Not applicable. The bug occurs without an agent turn.

## Relevant logs

No relevant log output. The problem is in the frontend click-routing path.

## Cause and verified repair direction

`FilesList.tsx` calls Tauri's `openPath(path)` for every file. This bypasses `ArtifactPolicyContext.openInApp`.

A local proof patch routes file clicks through `openInApp(path, basename(path))`. Supported Markdown and images then open in Berd, while unsupported files still use the operating system.

Verification completed against that patch:

- The new integration test failed before the change because the artifact-viewer state stayed empty.
- The focused `FilesList` tests pass: 6 of 6.
- The surrounding artifact-viewer tests pass: 49 of 49.
- `just check` passes.
- The full test run passes: 6,776 tests across 575 files, with one existing skip.
- An isolated app-driver run clicked a real fixture `README.md`. It created one `[data-artifact-viewer-panel]`, rendered one Markdown `h1`, matched the exact file in the viewer header, and did not start Xcode.

Contributor guide

Open the contributing guide

Research direction

Start in FilesList.tsx and inspect the ArtifactPolicyContext.openInApp entry point and existing click-routing tests. Run the focused FilesList tests first, then the surrounding artifact-viewer tests and just check. Done means Markdown opens in the sidebar artifact viewer while unsupported files still open through the operating system.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, tauri, typescript
Domain
desktop, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.