mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 21:49:42 +02:00
feat(docker): link to container attach from the Create New tab
Attaching lived only on the Docker tab, but the place users look for anything container-shaped is the "Run in an isolated Docker container" checkbox on Create New. A feature nobody can find is a feature nobody has. Adds a one-click link there that switches to the Docker tab, turns the toggle on and focuses the container field. Reuses switchCaseModalTab and the existing sync helper; no new CSS.
This commit is contained in:
@@ -2644,6 +2644,7 @@
|
||||
<div class="form-row docker-quick-row">
|
||||
<label class="checkbox-row"><input type="checkbox" id="newCaseDocker"> 🐳 Run in an isolated Docker container</label>
|
||||
<span class="form-hint">Runs this case in a hardened, isolated container. The base image is built automatically on first use. Docker/Podman must be installed.</span>
|
||||
<span class="form-hint">Already have a container running? <button type="button" class="btn-inline-check" id="dockerAdoptJumpBtn">Attach to it instead</button> — Codeman only <code>docker exec</code>s in and never touches its lifecycle.</span>
|
||||
</div>
|
||||
<details class="advanced-options docker-quick-settings" id="dockerQuickSettings">
|
||||
<summary><svg class="set-adv-chev" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg><span>Container settings (optional, sensible defaults)</span></summary>
|
||||
|
||||
@@ -2394,6 +2394,8 @@ Object.assign(CodemanApp.prototype, {
|
||||
if (adoptToggle) adoptToggle.onchange = () => this._syncDockerAdoptMode();
|
||||
const adoptCheck = document.getElementById('dockerAdoptCheckBtn');
|
||||
if (adoptCheck) adoptCheck.onclick = () => this._dockerAdoptPreflight();
|
||||
const adoptJump = document.getElementById('dockerAdoptJumpBtn');
|
||||
if (adoptJump) adoptJump.onclick = () => this.jumpToDockerAdopt();
|
||||
this._syncDockerAdoptMode();
|
||||
// Scroll-into-view on focus for mobile keyboard visibility
|
||||
modal.querySelectorAll('input[type="text"]').forEach(input => {
|
||||
@@ -2966,6 +2968,20 @@ Object.assign(CodemanApp.prototype, {
|
||||
else modal.removeAttribute('data-docker-adopt');
|
||||
},
|
||||
|
||||
/**
|
||||
* Cross-link from the Create New tab's "Run in an isolated Docker container"
|
||||
* row. Adoption lives on the Docker tab, but the place users actually look for
|
||||
* anything container-shaped is that checkbox, so this jumps them there with the
|
||||
* toggle already on rather than leaving the feature undiscoverable.
|
||||
*/
|
||||
jumpToDockerAdopt() {
|
||||
this.switchCaseModalTab('case-docker');
|
||||
const toggle = document.getElementById('dockerAdoptExisting');
|
||||
if (toggle) toggle.checked = true;
|
||||
this._syncDockerAdoptMode();
|
||||
document.getElementById('dockerContainerName')?.focus();
|
||||
},
|
||||
|
||||
/**
|
||||
* Read-only preflight against an existing container. It links nothing, so the
|
||||
* user can find out "not running" / "no tmux" / "codex present, claude missing"
|
||||
|
||||
Reference in New Issue
Block a user