Skip to content

feat(files): double-click opens text files as a preview in a new block - #62

Merged
Atreus-X merged 1 commit into
mainfrom
feat/files-dblclick-preview
Oct 2, 2026
Merged

Atreus-X merged 1 commit into
mainfrom
feat/files-dblclick-preview

Conversation

@Atreus-X

@Atreus-X Atreus-X commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Double-clicking a file in the Files view now opens a preview in a new block when the file is text-capable. Other files still open in the OS default app; folders still navigate in place.
  • New preview:doubleclickopen value "auto" (now the default). "external" and "preview" behave as before.
  • Text detection (frontend/util/textfiles.ts) checks a typical extension list first (source, config, markup, docs, shell, dotfiles like .gitignore, names like Makefile), then falls back to the mimetype. Mimetype alone misses e.g. .ts (sniffed as video) and .go.
  • The context-menu "Open Preview in New Block" now shares the same helper (openPreviewInNewBlock).

Testing

  • tsc --noEmit: no errors; vitest run: all pass, including new textfiles.test.ts; go vet ./pkg/wconfig/: clean.
  • Codegen (generateschema, generatego, generatets) run; only schema/settings.json changed.
  • Not exercised in the running app yet.

SSH / wsh

The new block uses the entry's own connection, exactly like the existing context-menu item, so it goes through whichever route that host uses (wsh, or plain SSH via SFTP). No wsh dependency added. Not yet verified on a live host of either kind.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W6QMXXvRReaKxWk1JL5Et6

New default for preview:doubleclickopen, "auto": text files (by extension
list or mimetype) open a preview block on the entry's connection; other
files still open in the OS default app; folders still navigate. "external"
and "preview" keep their old behavior.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6QMXXvRReaKxWk1JL5Et6
@Atreus-X Atreus-X mentioned this pull request Oct 1, 2026
@Atreus-X
Atreus-X merged commit e7564ef into main Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant