hub-client: a project with no files shows an editable buffer that is not a file, and a broken preview message

Open Beginner friendly
#957 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Start with hub-client/src/components/Editor.tsx and ts-packages/preview-renderer/src/overlays/PreviewStaticInfoViews.tsx, the two locations named in the issue. Check how each handles a null currentFile and how the Files panel creates or selects files. Done means a project with no files shows an empty state in both panes, offers the described New file action, and does not allow editing until a file is selected.

Written by the indexing model from the issue text.

Description

When a project has no files, the editor still renders an editable text buffer even though no file is selected (the document header says "No file selected"). Text typed there is not saved anywhere.

The preview pane next to it shows a broken message: "This .no currentFile path file can be edited in the editor".

Expected: with no file selected, show an empty state in place of the editor and the preview, for example "This project has no files yet. Create a file or pick one from the Files panel." with a New file action, and keep editing disabled until a file is created or picked.

Code pointers (v0.37.0):

  • hub-client/src/components/Editor.tsx renders <MonacoEditor> even when currentFile is null.
  • ts-packages/preview-renderer/src/overlays/PreviewStaticInfoViews.tsx builds the preview message from the empty path.
Dominant language
Rust
Stars
302
Forks
22
Avg merge
5h 2m
Merged PRs (30d)
213

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/q2

All issues in quarto-dev/q2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.