Skip to content

feat: add contact book manager app and Electron integration#68

Merged
mohamedmansour merged 9 commits into
mainfrom
feat/electron
Mar 5, 2026
Merged

feat: add contact book manager app and Electron integration#68
mohamedmansour merged 9 commits into
mainfrom
feat/electron

Conversation

@mohamedmansour

Copy link
Copy Markdown
Contributor

Add a sophisticated contact book manager example application and a generic Electron integration for running any WebUI app as a desktop application.

Contact Book Manager (examples/app/contact-book-manager/)

  • 17 Atomic Design components (6 atoms, 4 molecules, 6 organisms, 1 root)
  • 7 views: Dashboard, All Contacts, Favorites, Groups, Detail, Add, Edit
  • Full CRUD operations with IndexedDB offline persistence
  • 15 sample contacts across 4 groups (Family, Work, Friends, Other)
  • Responsive layout with sidebar (desktop) and single column (mobile)
  • FAST-HTML hydration with connectedCallback event listeners
  • CSS ::before pseudo-elements for emoji icons (avoids protocol encoding)

Electron Integration (examples/integration/electron/)

  • Generic Electron wrapper accepting CLI args: dist-dir, state.json, --plugin
  • Custom webui:// protocol scheme serves SSR HTML + static assets
  • Frameless window with titleBarOverlay for native window controls
  • Header component acts as drag handle via -webkit-app-region: drag
  • Uses process.dlopen for cross-platform native addon loading (.dll/.dylib/.so)
  • ESM throughout with import.meta.dirname for path resolution

Condition Parser Bug Fix (crates/webui-parser/src/condition_parser.rs)

  • Fix string literal quote-stripping in parse_predicate() that caused expression evaluator MissingValue errors for conditions like page == 'dashboard'. Quotes are now preserved for is_literal() checks.

Documentation

  • Add Electron handler page (docs/guide/concepts/handlers/electron.md)
  • Add Electron to handlers index and VitePress sidebar config
  • Add Examples section to Rust handler docs pointing to integration examples
  • Add electron to workspace catalog (pnpm-workspace.yaml)

Add a sophisticated contact book manager example application and a
generic Electron integration for running any WebUI app as a desktop
application.

Contact Book Manager (examples/app/contact-book-manager/)
- 17 Atomic Design components (6 atoms, 4 molecules, 6 organisms, 1 root)
- 7 views: Dashboard, All Contacts, Favorites, Groups, Detail, Add, Edit
- Full CRUD operations with IndexedDB offline persistence
- 15 sample contacts across 4 groups (Family, Work, Friends, Other)
- Responsive layout with sidebar (desktop) and single column (mobile)
- FAST-HTML hydration with connectedCallback event listeners
- CSS ::before pseudo-elements for emoji icons (avoids protocol encoding)

Electron Integration (examples/integration/electron/)
- Generic Electron wrapper accepting CLI args: dist-dir, state.json, --plugin
- Custom webui:// protocol scheme serves SSR HTML + static assets
- Frameless window with titleBarOverlay for native window controls
- Header component acts as drag handle via -webkit-app-region: drag
- Uses process.dlopen for cross-platform native addon loading (.dll/.dylib/.so)
- ESM throughout with import.meta.dirname for path resolution

Condition Parser Bug Fix (crates/webui-parser/src/condition_parser.rs)
- Fix string literal quote-stripping in parse_predicate() that caused
  expression evaluator MissingValue errors for conditions like
  page == 'dashboard'. Quotes are now preserved for is_literal() checks.

Documentation
- Add Electron handler page (docs/guide/concepts/handlers/electron.md)
- Add Electron to handlers index and VitePress sidebar config
- Add Examples section to Rust handler docs pointing to integration examples
- Add electron to workspace catalog (pnpm-workspace.yaml)
@mohamedmansour mohamedmansour requested review from a team, akroshg and janechu March 5, 2026 17:02
mohamedmansour and others added 2 commits March 5, 2026 11:17
…explicit CLI args

- Add ensureGroupButtons() to cb-contact-form that reads groups from
  the sidebar when the form is dynamically created (not SSR'd), fixing
  the empty group selector in Add/Edit Contact views
- Remove hello-world fallback defaults from electron and node
  integrations; both now require explicit dist-dir and state path
  args, printing usage on missing args
- Remove electron dependency from contact-book-manager; Electron is
  launched from integration/electron by passing app dist/state paths
- Update READMEs to reflect required args and removed electron section

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Register electron as an integration build that runs 'pnpm run build'
in examples/integration/electron, compiling main.ts and preload.ts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
akroshg
akroshg previously approved these changes Mar 5, 2026
mohamedmansour and others added 5 commits March 5, 2026 12:23
Add a Rust/actix-web server under examples/integration/ssr-performance-showdown
that replicates the spiral-tile benchmark from the ssr-performance-showdown
project (https://github.com/nicolo-ribaudo/ssr-performance-showdown).

The template (app/index.html) uses a <for each> loop over a tiles array
and is compiled ahead of time into dist/protocol.bin via webui build.
At startup the server loads the pre-built protocol binary. On every
request it computes ~2400 spiral tile positions (matching the showdown
parameters: 960x720 canvas, 10px cells, 0.2 angle step) and passes
them as JSON state to WebUIHandler, which renders the final HTML.

This keeps the runtime dependency surface minimal — only webui-protocol
and webui-handler are needed; the parser is not linked into the server
binary.
- Use glob pattern (crates/*) for crate members
- Add rust and ssr-performance-showdown as workspace members
- Inherit shared dependencies (serde_json, anyhow, actix-web) via workspace = true
- Remove standalone [workspace] declarations from example Cargo.tomls

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add entry in INTEGRATION_BUILDS for ssr-performance-showdown
- Fix clippy warnings: use RangeInclusive::contains, avoid json! macro unwrap

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	examples/integration/ssr-performance-showdown/Cargo.lock
#	examples/integration/ssr-performance-showdown/Cargo.toml
#	examples/integration/ssr-performance-showdown/README.md
#	examples/integration/ssr-performance-showdown/src/main.rs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@akroshg akroshg self-requested a review March 5, 2026 20:36
@mohamedmansour mohamedmansour merged commit c09710d into main Mar 5, 2026
10 checks passed
@mohamedmansour mohamedmansour deleted the feat/electron branch March 5, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants