Add repos from the page, answer actions in place, Expo-style redesign #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "session/add-repo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three things that were asked for together: add repos from the web page, stop making every click wait for a full reload, and redesign the page in the style of Expo's design language.
Add repository from the page
add-repo KEY OWNER/NAME. Off by default. It's on only whenconfig.tomlhas a[repo_add]section withbase_urlandowners. It's off on the dev box right now, see After merge below.<base_url><owner>/<name>.gititself and accepts only listed owners. It checks the repo withgit ls-remote(so the bot account must already have access), then appends the repo to[repos]under the lock and keeps the file at 0600.reposnow also reportsadd: {base_url, owners}. The page shows the Add repository form only when adding is on. It acceptsowner/nameor any ssh/https/scp clone URL on the same host. A URL on another host (say GitHub) is rejected on prod before any SSH call.set_toml_stringnow inserts a new key after the section's last key. Before, it went after trailing blank lines or the next section's comments.Responsiveness
The wait came from POST → 303 → GET, and every GET made two SSH calls (
list+repos), wherelistcosts ~0.7 s on the box.web/static/app.js, progressive enhancement. Every form still works with JS off. With JS on, forms are sent withfetchand the server answers{ok, message|error}as JSON instead of redirecting. The button and card change straight away (Stopping…, a dashed "Cloning" placeholder card for a new session), and a background refresh brings the real state. The list refreshes itself every 15 s, or every 3 s while something is starting or stopping or waiting for its Remote Control link. It refreshes only while the tab is visible. The archive section remembers whether it was open, and toasts replace the flash banner.reposis cached for 5 min and updated straight from theadd-repoanswer, so a page view costs one SSH call.listgets every unit's state from onesystemctl showinstead of one call per session: 676 → 374 ms on the dev box with 21 sessions. Output is identical to the installed version.?v=andimmutablecaching.script-src 'self'; connect-src 'self'. There is no inline script and nothing third-party. The cross-site POST check and the Authelia header check apply to the fetch requests too (tested).Redesign
The look follows Expo's design language. Slate greys, hairline borders, a black primary action (white in dark mode), tinted status badges with a dot, monospace repo/branch, and Inter/system type. On desktop it's two columns with a sticky side panel; on phones it stacks. Light and dark follow the system setting.
AGENTS.md changes
"No JavaScript" becomes "works without JavaScript;
app.jsis progressive enhancement" with the rules for keeping it that way. Invariant 2 now describesadd-repo. The README andconfig.example.tomlare updated to match.Tested
python3 -m unittest discover -s dev/tests: 36 OK, 8 new (add-repo validation/owner/dupes/unreachable/off, unit_states batching, TOML placement).python3 -m unittest discover -s web/tests: 21 OK, 11 new. These cover URL parsing, a real HTTP server with a fake dev box (JSON vs 303, CSP, asset caching, repos cache, cross-site/unauthenticated still refused, add-repo sends only owner/name).listfrom the new code against the live dev box (read-only): same result as the installed version.add-repowriting the live config.After merge
./dev/install.sh(installs the newsessions-ctl).~/.config/sessions/config.toml:web/static/).🤖 Generated with Claude Code
https://claude.ai/code/session_01MCUMXh8zZConC75Mptbeou
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.