Skip to content

Web page: one panel, the UART terminal as a collapsible section (1.16.2) - #106

Merged
compot-dev merged 1 commit into
masterfrom
web-one-panel
Nov 18, 2026
Merged

compot-dev merged 1 commit into
masterfrom
web-one-panel

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #105.

The -w page had two panels of different widths: "Power console" (760 px) and "UART terminal" (1100 px). Now it is one panel:

  • about 1000 px wide; lamps and readout on the left, the three buttons on the right; one column under 760 px;
  • a "UART terminal" bar at the bottom (a <button>, aria-expanded) opens and closes the terminal inside the panel; closed by default;
  • xterm.js and the WebSocket start on the first opening and stay, so output collects while the section is closed; a page that never opens it takes no terminal slot (/status terminals stays 0);
  • while closed, a lamp on the bar lights on new output and goes out on opening;
  • the open/closed choice is kept in localStorage (wrapped in try/catch: without storage it just starts closed);
  • make WEBTERM=0: no bar, the page as before but one width.

The Android terminal screen is unchanged. Screenshots in the three READMEs retaken on 1.16.2 (closed and opened), README text updated.

Before: two panels, 760 px and 1100 px, the terminal always open and connected.
After:

closed opened
closed opened

Checked locally (compot/cross, headless Chromium via puppeteer against a pty): build without warnings with default, WEBTERM=0 and USB=0; tests/test_vectis.py passes for the default and WEBTERM=0 builds (new check: one panel, the section starts closed); in the browser: closed on load, opens and connects on click, typing works, the lamp lights on output while closed and clears on opening, the choice survives a reload, narrow (400 px) layout is one column, no JS errors.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Unify the web console and make the UART terminal collapsible

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Combine power controls and the UART terminal in one responsive panel.
• Start the terminal on first opening; preserve its connection, activity indicator, and open state
 afterward.
• Add page-structure checks and update the documentation for version 1.16.2.
Merge Risk 🟡 Medium

Blast radius 🟡 Medium 💥 2 capabilities

  • 2 affected capabilities within one bounded functional scope: web_console.
  • The changed HTML and JavaScript directly control the browser's UART terminal, while the existing WebSocket endpoint supplies the same UART output and input.
  • These are producer/consumer hops of one web-console terminal behavior, not independent deployment layers.
  • The lamps, status readout, buttons, and their existing HTTP actions form one bounded web-console power-control behavior.
  • The changed deck and panel are presentation hops for that same capability; the server routes remain the consumer of the button actions.
Behavioral complexity 🟡 Medium 🧩 Interacting branches

  • Before: the terminal was initialized and connected immediately when the page script ran.
  • After: initialization is conditional on the first opening or a persisted 'open' value; the section can be open or hidden, localStorage can succeed or throw, xterm initialization can fail, output can arrive while hidden, and WebSocket close triggers reconnect.
  • New correctness condition: these states must agree so that hidden/open presentation, terminal initialization, focus/fit behavior, output indication, and the single persistent WebSocket remain coherent across toggles and reconnects.
  • The existing xterm and WebSocket mechanisms are reused, but the newly interacting lifecycle states are changed logic.
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the new lifecycle logic fails, an operator may lose browser terminal viewing or input until the page is refreshed, localStorage is cleared, the section is reopened, or the WebSocket reconnects.
  • Existing server-side UART handling and the power-control endpoints are not changed by this path.
  • No persistent device state or external compensation is required for the ordinary browser failure, although output that is not retained by the server history could be missed during a disconnected interval.
  • Usually reversible by reopening or refreshing the page and reconnecting; the source establishes reconnect scheduling but not a complete user-visible recovery guarantee for every initialization or storage failure.
Assessed commit 330b55f > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  Page["Power panel"] --> Bar{"Terminal opened?"} -->|"First opening"| Term["xterm session"] --> Socket["WebSocket"] --> UART["UART stream"]
  Bar -->|"Never opened"| Idle["No terminal slot"]
  Socket -->|"Output while closed"| Lamp["Activity lamp"]
  Bar -->|"Save choice"| Store["Browser storage"]
Loading
High-Level Assessment

The first-open initialization and persistent connection meet both goals: unopened pages consume no terminal slot, while previously opened pages retain output and activity notification when collapsed. Disconnecting on collapse would sacrifice that behavior, so it is not a better fit.

Files changed (6) +100 / -39

Enhancement (1) +50 / -21
vectis.cEmbed a responsive, collapsible UART terminal in the web panel +50/-21

Embed a responsive, collapsible UART terminal in the web panel

• Changes the page to one responsive panel and replaces the separate terminal panel with an accessible toggle and hidden section. Defers xterm and WebSocket initialization until opening, retains the connection on collapse, marks unseen output, persists the choice when storage permits, and bumps the version to 1.16.2. Terminal markup remains conditional on WEBTERM.

vectis.c

Tests (1) +6 / -0
test_vectis.pyCheck the single-panel, initially closed page markup +6/-0

Check the single-panel, initially closed page markup

• Adds assertions that the served page has one panel and that the terminal bar and body initially indicate a closed section. Existing terminal endpoint tests remain in place.

tests/test_vectis.py

Documentation (4) +44 / -18
CHANGELOG.mdRecord the 1.16.2 web-console changes +13/-0

Record the 1.16.2 web-console changes

• Adds release notes for the unified panel, collapsible terminal, deferred connection, activity lamp, and remembered section state.

CHANGELOG.md

README.mdDocument the new web-terminal workflow in English +12/-6

Document the new web-terminal workflow in English

• Revises screenshot descriptions and captions for version 1.16.2. Explains the collapsed default, first-open connection, retained output, activity lamp, and browser persistence.

README.md

README.ru.mdDocument the new web-terminal workflow in Russian +11/-6

Document the new web-terminal workflow in Russian

• Updates screenshot descriptions and captions and explains the terminal's collapsible, persistent-connection behavior.

README.ru.md

README.zh-CN.mdDocument the new web-terminal workflow in Chinese +8/-6

Document the new web-terminal workflow in Chinese

• Updates screenshot descriptions and captions and explains the terminal's collapsible, persistent-connection behavior.

README.zh-CN.md

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 62e68cf into master Nov 18, 2026
19 checks passed
@compot-dev
compot-dev deleted the web-one-panel branch November 18, 2026 08:44
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.

Web page: one panel, the UART terminal as a collapsible section below the power controls

1 participant