[Bug] Empty state appears before file finishes loading · Issue #5706 · marktext/marktext · GitHub
Skip to content

[Bug] Empty state appears before file finishes loading #5706

Open

Description

@kykak

Description

When clicking a file to open it, the UI immediately shows "No open tabs. Create new file." After a delay, the file/tab loads. This is misleading because the file exists, and there is no loading feedback during the delay.

Steps to Reproduce

  1. Open MarkText.
  2. Click on a file in the sidebar.
  3. See the error in the tab area.

Expected Behavior

Show a loading indicator (spinner/skeleton) while the file is loading. Only show the empty state when loading is complete and there are truly no open tabs.

Actual Behavior

The empty state "No open tabs. Create new file." is shown immediately. The file tab appears only after a delay, with no loading indicator.

Screenshots / Logs

Image

Operating System

Windows

MarkText Version

v0.21.2

OS Version

Windows11

Reproducibility

  • I can reliably reproduce this issue

Activity

  1. added
    🐛 bugSomething isn't working
    🪲 pri/lowSome low-priority bugs, such as styles, some bugs on non-primary features
    on Oct 11, 2026
  2. Jocs commented on Oct 14, 2026

    @Jocs
    Member

    Could you share a little more detail about the loading delay? Small Markdown files on a local disk would usually open quickly, so we'd like to understand what makes the delay noticeable in your case.

    • Approximately how large is the file, and how long does it take to open?
    • Is it stored directly on a local disk, or in a OneDrive/cloud-synced folder, network location, or external drive?
    • Does this also happen with a small, plain Markdown file, or only with particular files?
    • Does it happen only when no tabs are open, or also when another file is already open?

    A short recording or a sample file, if you can share one, would help us reproduce it. The delay could be in reading the file or in preparing/rendering the editor; these details would help us investigate the cause as well as the empty-state behavior.

  3. kykak commented on Oct 14, 2026

    @kykak
    Author

    Thanks for the reply. Here are the full reproduction details, with a screen recording:

    Recording: https://github.com/user-attachments/assets/35e6649a-592e-45c7-8ae0-b97a9b076f5f

    1. Symptom
    When opening a Markdown file, the window first appears blank, then shows the "No open tabs. Create new file." page, and only after that does the file tab appear. The empty state is misleading because the file does exist, and there is no loading feedback during the delay.

    2. File and storage environment

    • Happens with any Markdown file, including a nearly 0 KB plain text file.
    • Files are stored on a local D: drive, not OneDrive, a network location, or an external drive.
    • Ordinary Markdown files with no special content.

    3. Manual timing (stopwatch)

    • 6 KB file: window appears at ~1.9 s (blank), "No open tabs" appears at ~3.6 s, file appears within ~1 s after that.
    • 23 KB file: window appears at ~2.5 s (blank), "No open tabs" appears at ~4.6 s, file appears within ~1 s after that.
    • Most of the delay is in the blank window phase (~1.7–2.1 s); the "No open tabs" page itself usually only shows for under 1 s.

    4. Trigger pattern (key)

    • Happens right after the computer starts, and goes away after frequent use.
    • More likely with larger files / longer load times.
    • After a reboot: the issue appeared with a 6 KB file, but not with a 171-byte file.
    • At first I thought it was 100% reproducible, even after opening several files in a row; but the frequency gradually decreased, and eventually it stopped appearing. Now it only happens sometimes.

    5. On "only when no tabs are open?"
    I have not specifically compared opening a new file while another file is already open, but my impression is that the loading delay itself occurs in both cases; the empty state page only appears when there are no tabs.

    6. My assessment
    The delay is almost certainly not in reading the file itself — a nearly 0 KB local file also takes 1–2 seconds. It looks more like an issue in the phase from window initialization to tab rendering: the window / empty state is shown too early, before the tab is ready. The larger the gap (cold start, larger file), the more visible the "No open tabs" page is; when the gap is near zero (warm process, small file), it is not visible. It getting faster after frequent opens also matches a cold-start / cache-related behavior.

    7. Suggestion
    The empty state should only be shown after the "is a file currently loading" state is known, or a loading indicator (spinner/skeleton) should be shown during loading, instead of showing the empty state whenever there are no tabs.

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

    🪲 pri/lowSome low-priority bugs, such as styles, some bugs on non-primary features🐛 bugSomething isn't working🦋 optimizationImprove the existing behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions