development_optimization #1

Closed
timur wants to merge 0 commits from development_optimization into development
Owner
No description provided.
WebDAV is now served at /webdav/{context}/* on the main backend server.
No longer needs separate webdav_url - uses backend_url for all requests.

URL pattern: {backend_url}/webdav/{context}/{path}
- Add release profile with opt-level='z', LTO, single codegen unit, strip symbols, panic=abort
- Add wee_alloc as global allocator for smaller memory footprint
- Add wasm-opt optimization script with correct feature flags
- Update Makefile with release-optimized and sizes targets
- Results: ~14% size reduction (1.1MB -> 946KB for filesystem island)

Requires: brew install binaryen (for wasm-opt)
- Add release_max_level_warn feature to tracing
- Reduces filesystem island from 946KB to 931KB

Network transfer sizes (compressed):
- Gzip: 377KB
- Brotli: 299KB
- Switch to default-features = false with minimal + web + document
- Add Location, History, Url to web-sys features (required by dioxus-web)
- Removes devtools, logger overhead from release builds

Size reduction:
- 931KB -> 926KB (wasm-opt)
- 377KB -> 375KB (gzip)
- 299KB -> 297KB (brotli)
- Add 'mounted' feature to Dioxus (required for WebEventExt on MountedData)
- Add wasm-opt = false to settings island Cargo.toml
- Fix room island: use (*evt.data()).try_as_web_event() for Dioxus 0.7 API

All islands now build successfully with minimal Dioxus features.
Documents current optimization state, applied techniques, and architectural trade-offs for island WASM sizes.
- Add wee_alloc as global allocator for smaller WASM size
- Implement standalone feature flag for embedded vs separate builds
- Add IslandMetadata type for consistent metadata across islands
- Add WASM_OPTIMIZATION.md documentation
- Add optimization script with wasm-opt flags
- Makefile targets: release-optimized, sizes
- Expected savings: 83% when using embedded mode
- Update messaging/chats to use unified IdentityClient
- Update communication/room to use unified CommunicationClient
- Update intelligence/ai to use unified AiClient with chatservice_completion
- Update calendar to use unified CalendarClient
- Update system/contexts to use unified BaseClient
- Update code to use unified CodeClient

Services now work on all platforms (WASM, iOS, native) using the
unified clients from herozero-sdk that handle platform differences internally.
- Update calendar, ai, chats, chat_preview, contexts Cargo.toml files with mobile feature
- Make WASM dependencies optional with web/mobile feature flags
- Update os_components Cargo.toml to include mobile-compatible islands
- Update registry.rs to register islands for mobile platform

This enables these islands to compile for iOS/mobile targets.
- Add #[cfg(feature = "web")] gates to wasm_bindgen, web_sys, js_sys imports and usage
- Make calendar, ai, room, contexts app.rs files compile for mobile targets
- Add platform-independent helpers for timestamp generation in AI island

This fixes compilation errors when building islands for iOS/mobile.
Other islands (room, chats, chat_preview, calendar, ai, contexts) have
extensive web-specific code (js_sys, web_sys, wasm_bindgen) that needs
comprehensive cfg gating before they can compile for mobile.

For now, only contacts island is mobile-compatible.
- Create platform.rs module in core with unified APIs:
  - current_timestamp_ms(), current_timestamp_secs()
  - generate_id(prefix)
  - format_time(), format_date(), format_relative_time()
  - dispatch_event() - works on web, no-op on mobile
  - log(), warn(), error() - console on web, tracing on mobile

- Update islands to use platform abstractions:
  - AI island: app.rs, message_bubble.rs, message_list.rs
  - Chat preview: app.rs, chat_preview_component.rs
  - Contexts: app.rs

- Add mobile feature support for: contacts, ai, chats, contexts
- Update registry.rs to include mobile islands

This allows islands to compile for both web and mobile targets
without manual cfg gates throughout the codebase.
- Add platform abstraction layer in core (platform.rs) for cross-platform APIs
- Update AI, chats, chat_preview, contexts islands to use platform abstractions
- Update chats service to use unified CommunicationClient SDK (no mock data)
- Add mobile island imports and render cases in island_content.rs
- Fix page ordering: latest island appears first on mobile
- Remove redundant header/plus button from chats list (use toolbar instead)
- Fix Makefile to properly background web build in 'make all'
- Track touch start/end Y coordinates on dock container
- Detect swipe-down gesture (delta < -50px)
- Open AI island when swipe-down detected on mobile
- Add 44px icon containers with background around dock icons
- Make dock horizontally scrollable for overflow items
- Replace app icon with Home button in focused mode
- Center sections when 4 or fewer, scroll when more
- Increase mobile toolbar height to 40px
- Remove page indicator dots
- Adjust dock positioning and sizing for mobile
- Add object_view.rs with ViewForm and ViewState enums
- Add theme_vars.rs with CSS variable constants and style helpers
- Add OBJECT_VIEW_COMPONENTS.md documentation
- Add ContactObject component with Row, Block, and Panel views
- Add NewContactRow pattern for list view
- Implement unified Panel view (same layout for Readable/Writable)
- Merge ContactDetailView and ContactEditView into single component
- Use CSS variables for theme support
- Replace hardcoded colors with CSS variables for theme support
- Add NewContextRow as first item in list (dashed border style)
- Remove header 'New' button in favor of list row
- Export ViewForm, ViewState, css_var from core
- Add NewChatRow as first item in chats list (dashed border style)
- Pass on_new_chat handler to ChatsList
- Fix herozero-sdk workspace dependency to use package = hero_zero_sdk
- Hide NewChatRow when searching
- Use ssh://git@forge.ourworld.tf/lhumina_code/hero_zero.git
- Server now uses workspace dependency
Complete roadmap covering:
- Architecture (hero_forge -> herolib -> hero_zero -> hero_archipelagos)
- Current state assessment (development_optimization branch)
- Phase 1: Desktop shell polish (port hero_os JS UI to Dioxus)
- Phase 2: Mobile shell (full-screen layout, tab navigation)
- Phase 3: Missing islands (books, voice, forge, ledger)
- Phase 4: hero_zero_sdk type alignment
- Phase 5: Integration and wiring
- Phase 6: Promote shell to production location
- Phase 7: Build, CI, and deploy (ThreeFold Grid + web demo)
- Phase 8: Testing (unit, integration, E2E)
- Phase 9: Legacy retirement (hero_os and individual app repos)
- Dependency map and success criteria
Replace macOS-style top menu bar with archipelagos dock-centric approach:
- Dock is primary navigation hub (archipelago grouping, idle/focused modes)
- Developer tools drop-up menu from dock icon
- Services panel for managing hero_zero services
- Toolbar as three floating pills (Hero OS, App views, Context selector)
- Minimal window chrome (no traffic lights)
- Theme system driven by hero_zero settings domain
- Introduce `hero_archipelagos_business` package
- Implement Dioxus UI for CRM, Investments, Projects
- Register "business-island" custom element
- Update `Makefile` for island build and cleanup
- Rename `hero_zero_sdk` package to `hero_zero-sdk`
- Centralize common form input components
- Implement delete action with confirmation for all entities
- Add success notifications for create, save, and delete operations
- Update entity forms with rich input types (enums, dates, textareas)
- Expand dashboard with detailed metrics, pipeline, and activity views
- Refactor context name from 'herozero' to 'threefold'
- Restructured islands/ to archipelagos/ with domain-based organization
- Renamed shared/ to core/
- Fixed SDK API mismatches (String vs &str, reference parameters)
- Fixed SDK client Result handling
- Fixed SDK clients Clone trait by wrapping in Arc
- Updated WASM-only timer code with cfg guards
- All packages compile successfully
- Add #[cfg(feature = "standalone")] guards to unused imports in lib.rs files
- Remove unused imports (IslandContext, Agent, Role, Template, etc.)
- Fix deprecated chrono::NaiveDateTime::from_timestamp_opt usage
- Prefix unused variables with underscore
- Add #![allow(dead_code)] to example apps
- All packages now compile without warnings (except SDK which is external)
- Remove duplicate Props structs in message and chat_preview islands
- Use #[component] with inline props instead of separate Props struct
- Restore EditorMode, Role, Server, Template imports in intelligence app
- Conditionally use `*WasmClient` for `wasm32` target
- Adjust client `new` methods for WASM-specific constructors
- Pass owned values or `String` to WASM client methods
- Update service documentation to mention `*WasmClient`
- Add conditional compilation for SDK client types
- Add Business island metadata and view definitions
- Enable Business island rendering in web components
- Introduce `standalone` feature for Business island web component
- Adjust Business service calls for `wasm32` target
- Update base client ID from "root" to "herozero"
- Remove platform-specific client conditional compilation
- Use single SDK client types across all targets
- Eliminate unnecessary object cloning in service methods
- Update documentation to reflect unified client usage
- Refactor `CodeService` for multi-platform usage
- Implement web platform RPC and timestamp utilities
- Update build configuration for web and mobile targets
- Refactor Dioxus app launching mechanism
- Add Hero Browser Implementation Plan document
Add Forgejo CI workflows for build and release
Some checks failed
Build and Test / build (push) Failing after 1m8s
fea1899bf0
- build.yaml: Runs on push/PR, checks formatting, clippy, builds all
  WASM islands and server, runs tests
- build-release.yaml: Runs on version tags, creates optimized release
  builds and publishes WASM artifacts to package registry
- Add island.rs and wrapper.rs to core with Island/Archipelago types
- Refactor server build.rs to auto-scan archipelagos directory
- Generate registry.rs and router.rs from scanned metadata
- Update Cargo.toml dependencies and service imports across islands
- Remove outdated prompt documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merge branch 'development_optimization' of ssh://forge.ourworld.tf/lhumina_code/hero_archipelagos into development_optimization
Some checks failed
Build and Test / build (pull_request) Failing after 1m43s
Build and Test / build (push) Failing after 1m44s
6622a9ea9e
refactor: migrate from hero_zero_sdk to hero_osis-sdk
Some checks failed
Build and Test / build (pull_request) Failing after 1m38s
Build and Test / build (push) Failing after 1m7s
fe0632e467
- Replace hero_zero_sdk with hero_osis-sdk git dependency
  (ssh://git@forge.ourworld.tf/lhumina_code/hero_osis.git, branch main)
- Update all Cargo.toml files (23 crates) to use new SDK
- Update all Rust imports (87 files) to use hero_osis_sdk
- Fix API compatibility issues (references vs owned values)
- Temporarily disable filesystem/code islands (need heroforge-webdav-client)
- Temporarily disable os_components example (references missing islands)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
timur closed this pull request 2026-02-04 22:10:58 +00:00
Some checks failed
Build and Test / build (pull_request) Failing after 1m38s
Build and Test / build (push) Failing after 1m7s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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!1
No description provided.