Commit Graph

23 Commits

Author SHA1 Message Date
Brian Krabach 0f9623d2c2 refactor(views): introduce visibility helper and schema version (Phases 0+1)
## Phase 0 — Schema Version Field

- Added SCHEMA_VERSION = 2 constant and _schema_version field to DEFAULT_SETTINGS
  in muxplex/settings.py to support versioned federation.
- Added _schema_version to SYNCABLE_KEYS so peers see the version but
  apply_synced_settings never accepts an incoming version (one-way: send only).
- save_settings() always clamps _schema_version to current SCHEMA_VERSION.
- Added peer_supports_v2() helper for federation handshake.
- 6 new tests under "Schema version (Phase 0)" in test_settings.py.

## Phase 1 — Backend & Frontend Visibility Helpers

Backend (muxplex/views.py):
- Added is_hidden(key, settings), filter_visible(sessions, settings, view,
  *, include_hidden=False), visible_count(...), and normalize_session_keys()
  to provide read-time visibility filtering.
- Updated module docstring to describe v2 semantics (hidden is a property,
  not a placement; legacy enforce_mutual_exclusion retained as v1 backstop).
- 22 new tests covering the full filter matrix and normalization edge cases.

Frontend (muxplex/frontend/app.js):
- Added isHidden, filterVisible, visibleCount to app.js (pre-ES6 idioms).
- Replaced getVisibleSessions body with thin wrapper around filterVisible.
- Replaced 8 raw .length count sites in dropdown, settings, and Manage View
  to route through visibleCount.
- Settings panel shows "N sessions (M hidden)" when M > 0.
- Manage View "in this view" count uses includeHidden: true.
- 17 new tests in test_app.mjs covering the same matrix as backend.
- Updated 5 stale tests in test_frontend_js.py.

## Additional Updates

- Updated test_readme.py to exempt internal underscore-prefixed setting keys
  from README documentation requirement.
- Updated docs/plans/2026-05-17-hidden-state-redesign-design.md with COE
  corrections and design notes (federation truth, Phase 3 deferral, schema
  version semantics, local-only pruning state, federation tests).

All 1223 tests in muxplex/tests/ pass. All 17 new JS tests pass.
No raw .length count sites remain in counting code paths.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
2026-05-17 09:33:46 -07:00
Brian Krabach 8e53dbe1cf fix: address Phase 3 COE verification findings — tile click guard, disclosure visibility, mobile confirm, dead code cleanup 2026-04-15 21:57:38 -07:00
Brian Krabach 93889f7dda docs: add Views feature design
Adds design specification for user-defined Views — curated session
collections that span devices and replace the filtered gridViewMode.

Covers:
- Stable device identity prerequisite (device_id UUID in identity.json)
- Data model: views array in settings, active_view in state
- Three view tiers: All (virtual), user-created, Hidden (virtual)
- Mutual exclusion invariant between hidden and view membership
- UI: header dropdown view switcher, tile flyout menu, add sessions panel
- Migration strategy for session key format change
- Known limitations: rename breakage, atomic sync, shortcut cap
2026-04-15 09:38:29 -07:00
Brian Krabach 783611d143 fix: filter hidden sessions in browser indicators + add federation plan 2026-04-08 20:32:19 -07:00
Brian Krabach 4856094ca9 docs: add federation state propagation design 2026-04-08 17:38:08 -07:00
Brian Krabach ecc5e6d42a test: update frontend tests for server-side display settings 2026-04-08 11:18:16 -07:00
Brian Krabach 3bb3944b52 docs: add design for consolidating settings server-side
Move all display/UX settings from browser localStorage to server-side
settings.json. Flat keys approach (Approach A) - adds 10 new keys to
DEFAULT_SETTINGS, requiring zero changes to existing load/save/patch
functions or API endpoints.

Key decisions:
- No federation settings sync (each server owns its own settings)
- Drop notificationPermission (browser API is source of truth)
- sidebarOpen defaults to None for auto-detect on first load
- No migration needed - users reset preferences
- Fix auto_open vs auto_open_created naming alignment

Verified compatible with muxplex v0.2.0 (1b5207b).
2026-04-08 09:24:12 -07:00
Brian Krabach 9aac14212a chore: lint/format fixes 2026-04-04 08:22:36 -07:00
Brian Krabach 7db56e600f docs: TLS nudge design — contextual hints in doctor + service install 2026-04-04 03:29:36 -07:00
Brian Krabach 7b10c61327 docs: TLS setup implementation plans (Phase 1 foundation + Phase 2 auto-detection) 2026-04-03 22:44:17 -07:00
Brian Krabach 1ffffc8d26 docs: add HTTPS/TLS setup design
Design for muxplex setup-tls command with auto-detection:
- Tailscale cert (real LE, universally trusted)
- mkcert (local CA, zero browser warnings)
- Self-signed fallback (works but browser warns)

Covers settings integration, CLI flags, service integration,
doctor diagnostics, and error handling edge cases.
2026-04-03 22:44:17 -07:00
Brian Krabach 92a7d63ff5 docs: add federation_key to README settings table + commit CLI plan files
Fixes test_readme_documents_all_settings_keys — federation_key was added
by the federation feature but not documented in README. Also commits the
CLI refactor plan files as historical ADRs.
2026-04-03 05:52:25 -07:00
Brian Krabach 66f58a6f4b docs: comprehensive README rewrite + plans archive note
README now documents all features, 14 config keys, full CLI reference,
keyboard shortcuts, platform support, and project structure. Previous
README covered ~40% of actual functionality. Added docs/plans/README.md
noting these are historical ADRs from the initial build.

Added 9 new README tests verifying all settings keys are documented,
clipboard features, keyboard shortcuts, auth modes, platform support,
ANSI previews, hover preview, and view modes.
2026-04-01 10:57:17 -07:00
Brian Krabach c745660afe docs: CLI & service management refactor design
- Config file (settings.json) becomes source of truth for serve options
- Replace install-service with muxplex service <command> subgroup
- Clean up CLI structure (upgrade/update alias, serve flag precedence)
- Thin wrappers over systemctl/launchctl for install/uninstall/start/stop/restart/status/logs
- Backward compat: install-service remains as deprecated alias
2026-03-31 15:01:49 -07:00
Brian Krabach ac0b84c1d9 feat: openSession — full remote routing via sourceUrl 2026-03-31 03:40:57 -07:00
Brian Krabach a5b02b74d2 Add multi-device federation design document
Covers:
- Backend settings & remote instance registry
- Frontend multi-origin API layer with parallel polling
- View modes (flat/grouped/filtered) & device tagging
- Remote auth flow (per-instance browser auth)
- Terminal connection for remote sessions (direct WebSocket)
- Unreachable instance handling with exponential backoff
- Cleanup: remove Caddyfile, requirements.txt, expand WS proxy tests
2026-03-30 20:04:13 -07:00
Brian Krabach 80dc082df0 refactor: remove command palette HTML and CSS 2026-03-29 22:12:07 -07:00
Brian Krabach 77eecd1d72 docs: add settings panel and new session design document 2026-03-29 21:55:40 -07:00
Brian Krabach 0dbf8ca2cb docs: add authentication design document
Covers PAM + password auth modes, localhost bypass, session cookies,
service installation (systemd/launchd), and testing strategy.
2026-03-28 19:26:33 -07:00
Brian Krabach be26d40a31 docs: add distribution packaging implementation plan 2026-03-28 01:57:30 -07:00
Brian Krabach 41ff94afb1 docs: add session sidebar implementation plan 2026-03-27 18:06:44 -07:00
Brian Krabach 95c1ec1ad4 docs: add session sidebar design document 2026-03-27 16:05:57 -07:00
Brian Krabach 8234e2ec05 refactor: restructure project into muxplex/ subdir with brand integration
- Move coordinator/, frontend/, Caddyfile, pyproject.toml, requirements.txt,
  docs/ into muxplex/ subdir in prep for packaging/sharing
- Add brand assets to frontend/: favicon.ico, pwa-192/512.png,
  apple-touch-icon.png, wordmark-on-dark.svg
- Update app: title → muxplex, header → wordmark SVG, brand color tokens
  in style.css, manifest.json updated with muxplex name and brand icons
- Add design system: assets/branding/tokens.css (101 CSS custom properties),
  tokens.json (127 tokens), DESIGN-SYSTEM.md (856-line spec)
- Add assets/branding/: SVG sources, rendered PNGs (icons, favicons, PWA, OG)
- Add scripts/render-brand-assets.py for reproducible PNG generation
- Add muxplex/README.md
2026-03-27 15:06:00 -07:00