Skip to content

Persistent connection dialog #708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

danditomaso
Copy link
Collaborator

This is code that was taken from #645, @tpaulsoncdw is the only author of this PR. This PR brings his changes up to date with main. Below was taken from his PR. He deserves to be recognised for this wonderful contribution that wasn't merged at the time.

--- Original PR below
Looking to help how I can and this is an area that has impacted me so i though maybe i could help with this. it needs some more polish and testing but its not far off.

Description

Adds persistent HTTP node connections with optional HTTPS toggle, enabling simply reconnection across page refresh or tab reload.

Introduces a unified tabbed UI for connecting via HTTP, Bluetooth, or Serial, reducing friction for new users and testing workflows.

Related Issues

Relates to #345
Fixes #241
Fixes #164
Fixes #701

Changes Made

  • Introduced new tabbed UI for connection modal (HTTP, Bluetooth, Serial)
  • Implemented localStorage-based persistence of node connections
  • Added HTTPS toggle and support for self-signed or trusted certs
  • Updated HTTP connection logic for cleaner separation and recovery
  • Restructured sections into reusable components for better clarity and extensibility
  • Fixed numerous linting issues across touched files
  • Minor cleanup of unused imports and unused variables (in progress)

Testing Done

  • Verified HTTP(S) node addition with:

  • Let's Encrypt–signed certs

  • Self-signed certs (via NGINX + local DNS)

  • Confirmed nodes persist after refresh and page reloads

  • Tested multi-node handling with different protocols

  • Observed successful connection status returns in some cases

    • Needs further optimization for reliability
  • Initial test results are promising, but status polling is incomplete

  • Unencrypted HTTP (non-TLS) needs final testing and browser validation

Screenshots (if applicable)

Connect Modal:
image

Add new http connection Bluetooth Tab Serial Tab

Checklist

  • Code follows project style guidelines
  • Documentation has been updated or added
  • Tests have been added or updated
  • All i18n translation labels have been added

Future Enhancements

  • Complete implementation for unencrypted HTTP node support

philon- and others added 6 commits June 12, 2025 11:06
* Remove deprecated meshtastic/js dependency

* Bump dependency version

* Fix linting

---------

Co-authored-by: philon- <[email protected]>
  servers and i18n support

  - Move connection tabs from Dialog to PageComponents/Connect/Tabs for better
  organization
  - Add persistent HTTP server storage with status tracking in appStore
  - Implement hostname parsing and validation utilities
  - Default new HTTP connections to HTTPS for better security
  - Add comprehensive i18n translation support for all connection tab strings
  - Remove package-lock.json in favor of deno.lock dependency management
  - Update connection tab UI with improved server management (add/edit/remove)
  - Remove preliminary status checking logic (to be reimplemented with toradio API)
  - Maintain fixed window constraints for large monitor compatibility
  - Remove automatic server status checking from HTTP components
  - Eliminate status tracking overhead in HTTPServerSection and HTTP tab
  - Simplify persistent server list by removing status indicators
  - Clean up unused imports and status-related functions
  - Replace || with ?? for nullish coalescing consistency
@Copilot Copilot AI review requested due to automatic review settings July 11, 2025 17:50
Copy link

vercel bot commented Jul 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
web-test ✅ Ready (Inspect) Visit Preview Jul 11, 2025 7:32pm

@danditomaso danditomaso changed the title Persistent connetion dialog Persistent connection dialog Jul 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR brings the persistent connection dialog feature up to date with main, introducing a unified tabbed UI and server history persistence.

  • Dashboard now uses NewConnectionDialog with HTTP/Bluetooth/Serial tabs and conditionally inlines tabs when no devices exist.
  • Added hostname parsing and formatting utilities (parseHostname, formatHostnameForConnection, etc.).
  • Extended appStore to track savedServers with add/remove/update operations and localStorage persistence.
  • Minor UI refinements in tabs and connection components across Serial, HTTP, and Bluetooth integrations.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/web/src/pages/Dashboard/index.tsx Replaced old connect dialog with NewConnectionDialog, added inline ConnectionTabs and conditional rendering.
packages/web/src/core/utils/hostname.ts Introduced parseHostname, validation helpers, and formatting functions.
packages/web/src/core/stores/appStore.ts Added savedServers state, CRUD methods, and localStorage syncing.
packages/web/src/core/hooks/useLocalStorage.ts Adjusted effect dependency arrays in useLocalStorage hook.
packages/web/src/components/UI/Tabs.tsx Enhanced active state styling in TabsTrigger.
packages/web/src/components/Dialog/NewConnectionDialog.tsx New wrapper dialog for connection tabs.
packages/web/src/components/ConnectionTabs/ConnectionTabs.tsx Layout component for HTTP/Bluetooth/Serial tab selection.
packages/web/src/components/PageComponents/Connect /* Added new HTTP, Bluetooth, and Serial tab implementations under Connect/Tabs.
packages/web/src/App.tsx Redirect to messages on device connect and updated routing logic.
Comments suppressed due to low confidence (1)

packages/web/src/pages/Dashboard/index.tsx:99

  • The Heading component is used here but not imported at the top of the file. Please add the appropriate import, for example:

import { Heading } from "@components/UI/Typography/Heading.tsx";

                <Heading as="h3">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants