Skip to content

IDE: PDF and image viewer tabs, on a generic custom-editor tab seam #256

Done

Description

@aMonteSl

As a developer using the Code-XR IDE, I want PDF files and images in my folder to open in an editor tab, so that I can read papers, specs and diagrams without leaving the IDE.

Today the editor refuses binary files with "X is a binary file." (renderer/editor/editorGroup.ts).

Scope

  • Generic custom-editor seam in editorGroup.ts
    • openCustom(input): a tab whose content is a DOM element instead of a Monaco model.
    • It reuses the normal tab behaviour: preview tabs, close and middle-click, drag between groups, split, and session restore through registerCustomEditor(resolver).
    • The agent-first layout will open chat tabs through the same seam.
  • PDF viewer
    • pdf.js, bundled with its worker. No CSP relaxation: frames and objects stay forbidden.
    • Pages are rendered lazily on canvas, with the text layer so text can be selected and copied.
    • Zoom in and out, fit width, page number and page count, find in the document, and keyboard scrolling.
    • It reloads when the file changes on disk.
  • Image viewer
    • png, jpg, gif, webp, bmp, ico and avif.
    • svg is deliberately not included: it can carry script, so it stays a text file.
    • Zoom, fit, actual size, and the image dimensions and size in the toolbar.
  • Main process
    • Binary reads stay inside the folder, are size-capped, and do not depend on trust (they are read-only).

Acceptance criteria

  • Opening a .pdf from the explorer, Quick Open or search shows its pages in a tab; text is selectable and Ctrl+F finds it.
  • Opening an image shows it in a tab, with zoom and its size.
  • The tabs behave like file tabs: preview, keep, close, move to the other group, and restore after a restart.
  • A file changed on disk re-renders; a deleted one shows that it is gone.
  • The CSP is unchanged.
  • Unit tests cover the read limits and the seam; the smoke test passes on all three OSes.

Done in PR #280, merged into ide.

Activity

  1. added
    tfm
    user-story
    area: ide
    on Nov 27, 2026
  2. added 2 commits that reference this issue on Nov 27, 2026
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: idestream: ide-powertfmuser-story

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions