refactor(office island): route upload/delete through hero_office RPC #164

Merged
zaelgohary merged 2 commits from development_refactor_office_island_unified_rpc into development 2026-04-27 09:05:07 +00:00
Member

Summary

Browser previously talked to two backends — hero_office for list_documents, direct hero_foundry REST for upload/delete. Unify on hero_office: route upload/delete through the new upload_document / delete_document JSON-RPC methods (base64 payload). Browser now knows one backend.

Pairs with lhumina_code/hero_office PR adding the server-side RPCs. Must merge after that PR — the browser will call methods that do not yet exist on the server otherwise.

Changes

  • archipelagos/embed/office/Cargo.toml+ base64 = "0.22"
  • archipelagos/embed/office/src/service.rs — single rpc_call helper; upload_file/delete_file now POST to /hero_office/rpc; dropped the file_url helper and the hero_foundry path
  • archipelagos/embed/office/src/views.rs — drive-by collapse of a single-arm match flagged by clippy 1.93 single_match

Test Results

  • cargo check --target wasm32-unknown-unknown -p hero_archipelagos_office
  • cargo clippy --target wasm32-unknown-unknown -p hero_archipelagos_office -- -D warnings
  • cargo fmt --check on touched files

Manual verification

  • WASM bundle rebuilt and deployed; hero_os UI loads with the new browser code.
  • tests/e2e/office_upload.spec.ts (the spec that exercises the Upload-button → file-list flow) — confirms the browser-side base64 path through upload_document works end-to-end.
  • tests/e2e/office_editor_real.spec.ts 4/4 — editor still opens and saves for docs / sheets / presentations / pdf.
## Summary Browser previously talked to two backends — `hero_office` for `list_documents`, direct `hero_foundry` REST for upload/delete. Unify on `hero_office`: route upload/delete through the new `upload_document` / `delete_document` JSON-RPC methods (base64 payload). Browser now knows one backend. ## Related Issue Pairs with `lhumina_code/hero_office` PR adding the server-side RPCs. **Must merge after that PR** — the browser will call methods that do not yet exist on the server otherwise. ## Changes - `archipelagos/embed/office/Cargo.toml` — `+ base64 = "0.22"` - `archipelagos/embed/office/src/service.rs` — single `rpc_call` helper; `upload_file`/`delete_file` now POST to `/hero_office/rpc`; dropped the `file_url` helper and the hero_foundry path - `archipelagos/embed/office/src/views.rs` — drive-by collapse of a single-arm `match` flagged by clippy 1.93 `single_match` ## Test Results - `cargo check --target wasm32-unknown-unknown -p hero_archipelagos_office` ✅ - `cargo clippy --target wasm32-unknown-unknown -p hero_archipelagos_office -- -D warnings` ✅ - `cargo fmt --check` on touched files ✅ ## Manual verification - WASM bundle rebuilt and deployed; `hero_os` UI loads with the new browser code. - `tests/e2e/office_upload.spec.ts` (the spec that exercises the Upload-button → file-list flow) ✅ — confirms the browser-side base64 path through `upload_document` works end-to-end. - `tests/e2e/office_editor_real.spec.ts` 4/4 — editor still opens and saves for docs / sheets / presentations / pdf.
refactor(office island): route upload/delete through hero_office RPC
Some checks failed
Build and Test / build (pull_request) Failing after 3h13m1s
881bcb6414
Browser previously talked to two backends — list_documents via
hero_office RPC, upload/delete via direct hero_foundry REST. Unify on
hero_office: add upload_document and delete_document RPC calls (base64
payload) and drop the hero_foundry path. The browser now knows one
backend.

Drive-by: collapse a single-arm match in views.rs that the new clippy
in 1.93 flags as single_match.

Depends on lhumina_code/hero_office#<TBD> (server-side RPCs) being
merged first.
fix(office island): gate base64 import + rpc_url to wasm32
All checks were successful
Build and Test / build (pull_request) Successful in 5m27s
6b4e7b63a2
Fixes CI clippy failure on native target:
- unused import `base64::Engine`
- dead code: method `rpc_url`

Both are only referenced inside #[cfg(target_arch = "wasm32")] functions
so they show as unused when compiling for native.
zaelgohary merged commit 1fb9d1754f into development 2026-04-27 09:05:07 +00:00
zaelgohary deleted branch development_refactor_office_island_unified_rpc 2026-04-27 09:05:07 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos!164
No description provided.