fix(ui): add async feedback and correct empty-state copy on dashboard #41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_dashboard_ux_fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #38.
Summary
Fixes four small dashboard UX defects: missing async feedback on Create Deck, wrong empty-state copy when a deck is selected with zero slides, black flash when opening the lightbox the first time, and a thumbnail flash to black after Create Slide. JS + HTML + CSS only — no Rust changes.
Changes
showPromptnow disables the OK button, swaps its label with a Bootstrap spinner, disables the input + Cancel, and only closes the modal in afinallyafter the RPC resolves. Same fix incidentally improves Create Folder, Insert Slide, Move Slide, Rename Deck, Duplicate Deck.#slides-emptyinto#slides-empty-no-deck("Select a deck to view slides.") and#slides-empty-no-slides("No slides yet — click Create Slide to add one.").loadSlidesForDeckandrenderSlidestoggle the right one.#preview-spinneroverlay;showPreviewSlideadds aloadingclass to the image, shows the spinner, and clears both viaonload/onerror. Cached-image short-circuit viaimg.complete && img.naturalWidth > 0.doCreateSlidenow capturesslide.insertresponse and callsappendSlideCard(inserted, slug)instead ofloadSlidesForDeck(). Direct DOM append, no full reload. Guard rail: ifinserted.new_nameis missing, falls back to the full reload.Files
Test results
cargo test --workspace: 98 passed / 0 failed / 1 ignored (the AI-gated test). Same baseline asdevelopment.cargo fmt --check: clean.cargo clippy --workspace --no-deps: only the 2 pre-existingunnecessary_sort_bywarnings inslide_ops.rs:219and:448(unchanged fromdevelopment).Test plan
Notes
showPromptchange is a small contract shift: previously the modal closed beforeonConfirm; now it closes after. All 7 callers were audited and none rely on the old timing.appendSlideCardwrites directly tocurrentSlides, bypassing the server. If state ever drifts (e.g. concurrent edits), the next full reload reconciles. Acceptable for the single-user Hero context.dashboard.jsanddashboard.cssare static assets embedded viarust_embed. After deploy users may need a hard refresh, and thehero_slides_uibinary needs rebuilding.