Skip to content

UI: open presentations in the background with a progress window (#350) - #488

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:feat/350-open-progress
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
NikitkaRa:feat/350-open-progress

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Closes #350.

Summary

  • Opening a presentation from File ▸ Open (the picker) or from the Backstage recent list no longer freezes the window. The file is read and parsed on a background thread.
  • While it loads, a modal progress window sits over the app: a spinner, "Opening …", the seconds so far, and Cancel. Escape also cancels.
  • Cancel gives the window back at once and leaves the open presentations as they were. The abandoned read finishes on its thread and its result is dropped.
  • Errors (missing file, unreadable deck) go to the status bar, as before. Starting a second open while one is running says "Still opening …" instead of queueing it.
  • Engine: file.open is split into read_presentation_file(path) -> LoadedFile, which needs no session, and add_presentation_file(session, LoadedFile). file.open behaves exactly as before. Control-channel, MCP, CLI and command-line opens stay synchronous.
  • Web build: no threads there, so these opens stay synchronous.
  • Not in this PR: a real percentage. The PPTX importer has no progress callbacks yet, so the window shows elapsed time instead of a filling bar.

Test plan

  • opening::tests:
    • A saved deck opens in the background, becomes the active document and is first in the recent list.
    • Cancel drops a late result.
    • A missing file reports in the status bar, and a second open while one is running is refused with "Still opening".
    • Kittest: the window shows "Opening Big deck.pptx…", and clicking Cancel closes it without adding a document.
  • backstage_tests::open_lists_recent_files_and_opens_one: now waits for the background read.
  • Looked at the window (rendered with the kittest harness over the editor): centred card, spinner, file name, elapsed seconds, Cancel.
  • cargo xtask ci: fmt, clippy -D warnings, test, assets, layers, wasm all pass.
  • Manual check with a very large real-world PPTX on desktop (not run here)

No parity-checklist row changes: this is a responsiveness feature with no checklist row.

…ytold#350)

Opening from the file picker or the Backstage recent list read and parsed
the file on the UI thread, so a large PPTX froze the window. The read now
runs on a thread (engine: read_presentation_file / add_presentation_file),
and a modal shows the file name, elapsed time and Cancel; Escape cancels
too. A cancelled read is dropped when it finishes. Scripted opens (control,
MCP, CLI) and the web build stay synchronous.

Co-authored-by: Cursor <cursoragent@cursor.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 62bb8d6 into storytold:main Oct 14, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
The progress window's result was added with add_presentation_file, straight
into the session: not journaled and outside the command panic guard that
file.open runs under. The host now hands the loaded file to
Session::stage_loaded and runs the new internal command file.adopt {path,
token}, which shares file.open's tail (repaired-copy handling, damaged-media
report) and so is journaled and guarded. Without the staged copy (a replayed
journal, a stale token) file.adopt reads path like file.open. Reading still
happens on the background thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
… screen

Main (#346) shows why a file couldn't be opened as a notice over the start
screen; #488's background open put the error in the status bar instead, which
broke a_file_that_cant_be_opened_says_why. The background open now reports
through the same notice, and the test waits for the background read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
# Conflicts:
#	crates/engine/src/cmd/mod.rs
#	crates/ui-egui/src/ribbon.rs
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @NikitkaRa! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
…#291 after #488)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Feature - File opening progress window

3 participants