tui: async storage operations — don't block event loop on gallery/entity loads #125
Labels
No labels
area:agents
area:ai
area:config
area:dashboard
area:design
area:design-review
area:devtools
area:entities
area:gallery
area:generate
area:image
area:infra
area:meta
area:model-browser
area:navigation
area:presets
area:security
area:sessions
area:settings
area:sharing
area:test
area:ux
area:webhook
area:workdir
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/loom#125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
User story
As a user with a large gallery (1000+ items), I want the TUI to stay responsive while loading data, so that navigation and input aren't frozen during storage reads.
Problem
Several screens perform synchronous SQLite reads inside
handle()orrender():gallery.rsload_from_storage()— callsguard.list(&filter)synchronouslyentities.rsload_from_storage()— callsguard.list_entities()synchronouslypresets.rsload_from_storage()— callsguard.list_presets()synchronouslyThese hold a
std::sync::Mutexlock onGalleryStorageand block the tokio event loop. For small datasets this is fine, but with large galleries the UI freezes.Acceptance criteria
load_from_storage()spawns atokio::spawn_blockingtask instead of blocking inlineAppAction::GalleryLoaded(Vec<GalleryItem>)or similarOut of scope
References
crates/loom-tui/src/screens/gallery.rs—load_from_storage()crates/loom-tui/src/screens/entities.rs—load_from_storage()crates/loom-tui/src/screens/presets.rs—load_from_storage()tokio::task::spawn_blockingfor CPU-bound / mutex-holding work