Office island: persist editor iframe + file list across navigation #165
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_archipelagos#165
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?
Symptom
Two UX inefficiencies in
archipelagos/embed/office:service::list_documentsagain, even though nothing changed.Cause
OfficeApptogglesInnerView::List <-> InnerView::Edit; whenEditexits, theEditorView's iframe is dropped. NextEditmounts a fresh iframe.FileListViewowns theResource<Vec<DocumentEntry>>; the resource is dropped on unmount and re-created on remount.Proposed fix
OfficeApp. On filename change, calleditor.destroyEditor()thennew DocsAPI.DocEditor(...)on the same<div id="placeholder">. Sub-second swap.Resource<Vec<DocumentEntry>>fromFileListViewintoOfficeAppso it persists across the InnerView toggle. Add an explicit "Refresh" handler that the user already has.Acceptance
Update: tried two approaches to make the file list survive List ↔ Edit nav. Both fail — the second approach surfaces a Dioxus diff/remount behaviour I do not yet understand.
Attempt 1 — CSS toggle keeps
FileListViewmountedExpectation: FileListView never unmounts →
use_resourcehook persists. Result: still re-fetches on back-nav.Attempt 2 — Lift
use_resourcefromFileListViewintoOfficeAppResource owned by OfficeApp (which never unmounts during nav), passed as a prop to
FileListView. Sameuse_resource(closure)shape, just at a different level.Result: still re-fetches on back-nav. Playwright trace:
Hypothesis
Either OfficeApp is being re-mounted by hero_os's window manager when the inner
currentsignal changes (so all hooks reset), or Dioxus 0.7'suse_resourceReactiveContext tracks something subtle that's invalidated by adding/removing the conditionalEditorViewsibling. Addingkey:attributes for stable identity ran into a Dioxus restriction (key:requires interpolation syntax), but is a path worth pursuing.Next steps for whoever picks this up
tracing::info!("OfficeApp render")to the top of the function and confirm whether OfficeApp re-mounts (multiple "first render" traces) or just re-renders.use_resourceReactiveContext — a memoized endpoint viause_memomay stabilize the captured deps.Reverting today's local attempt; the live stack on
origin/developmentis unchanged. Issue stays open.