Skip to content

(touched): open every clicked file in Touched, with markdown formatted by default #472

Description

@jbr-sekoia

Request

  1. A markdown file opened from Touched can be read formatted, not only as source.
  2. Markdown opens formatted by default, whether the file is opened from a click in the terminal or from Touched.
  3. One feature instead of two: clicking a file opens the Touched panel with that file selected and open in it.

Current state (375decb)

  • A click on a path in the terminal goes through openFileInPanel (public/file-panel.js:913). A file changed in git opens in the Changes editor; any other file opens in a 'file' tab rendered by the panel's ViewerPanel, which has a preview for markdown but starts in source (no storageKey).
  • A click on a Touched row goes through openTouchedFile (public/touched-files-view.js:264) to openTouchedEditor (public/file-panel.js:1245), which builds a Changes-type tab. It has no markdown preview.
  • The same gesture, opening a file, is served by two editors, and the preview exists in one of them only.

Decisions taken

  • A click on a local session's file opens Touched with the file selected and its content in the Touched editor. The 'file' tab type and the panel's ViewerPanel go, once what depends on them (held dirty tabs, unsaved-edits check on quit, the CLI's open-file route, path:line) has moved. The Memory and .work-files viewers keep their own ViewerPanel.
  • A clicked file that the file tools did not touch is added to the top of the list, marked as opened rather than touched, under the same guards as today's click route.
  • Markdown gets a formatted mode in that editor, on by default, with the user's choice remembered. A path:line click opens the source at that line.
  • Remote sessions are unchanged: path links are already refused there, and Touched is local only.

The specification, with acceptance criteria, follows in a comment once it has been reviewed.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions