Skip to content

Commit 15d7221

Browse files
authored
Merge pull request #5 from markrai/bug/workflow-lane-add-button
bugfix: workflow lane add button introduced
2 parents b483ea4 + 3338bca commit 15d7221

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

internal/httpapi/web/dist/views/projects.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ function renderWorkflowEditorBody(lanes, listId = "workflowModalLaneList", ghost
110110
</div>
111111
`).join("")}
112112
</div>
113-
<div class="row">
114-
<input class="input" id="${escapeHTML(ghostId)}" placeholder="Add lane..." />
113+
<div class="row" style="gap:8px;align-items:center;">
114+
<input class="input" id="${escapeHTML(ghostId)}" placeholder="Add lane..." style="flex:1;min-width:0;" />
115+
<button type="button" class="btn btn--small" id="workflowModalGhostAdd" aria-label="Add lane">Add</button>
115116
</div>
116117
`;
117118
}
@@ -183,6 +184,7 @@ function createWorkflowEditorRenderer() {
183184
onLanesChange();
184185
});
185186
});
187+
const ghostAddBtn = container.querySelector("#workflowModalGhostAdd");
186188
if (ghostInput) {
187189
const commitGhostLane = () => {
188190
const text = (ghostInput.value || "").trim();
@@ -191,15 +193,18 @@ function createWorkflowEditorRenderer() {
191193
insertLaneBeforeDone(lanes, text);
192194
ghostInput.value = "";
193195
onLanesChange();
196+
requestAnimationFrame(() => {
197+
const next = container.querySelector(`#${ghostId}`);
198+
next?.focus();
199+
});
194200
};
195201
ghostInput.addEventListener("keydown", (e) => {
196202
if (e.key === "Enter") {
197203
e.preventDefault();
198204
commitGhostLane();
199205
}
200206
});
201-
ghostInput.addEventListener("input", () => { commitGhostLane(); });
202-
ghostInput.addEventListener("blur", () => { commitGhostLane(); });
207+
ghostAddBtn?.addEventListener("click", () => { commitGhostLane(); });
203208
}
204209
if (list && typeof Sortable !== "undefined") {
205210
sortableInstance = Sortable.create(list, {

internal/httpapi/web/modules/views/projects.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ function renderWorkflowEditorBody(
131131
</div>
132132
`).join("")}
133133
</div>
134-
<div class="row">
135-
<input class="input" id="${escapeHTML(ghostId)}" placeholder="Add lane..." />
134+
<div class="row" style="gap:8px;align-items:center;">
135+
<input class="input" id="${escapeHTML(ghostId)}" placeholder="Add lane..." style="flex:1;min-width:0;" />
136+
<button type="button" class="btn btn--small" id="workflowModalGhostAdd" aria-label="Add lane">Add</button>
136137
</div>
137138
`;
138139
}
@@ -201,19 +202,23 @@ function createWorkflowEditorRenderer() {
201202
});
202203
});
203204

205+
const ghostAddBtn = container.querySelector("#workflowModalGhostAdd") as HTMLButtonElement | null;
204206
if (ghostInput) {
205207
const commitGhostLane = () => {
206208
const text = (ghostInput.value || "").trim();
207209
if (!text) return;
208210
insertLaneBeforeDone(lanes, text);
209211
ghostInput.value = "";
210212
onLanesChange();
213+
requestAnimationFrame(() => {
214+
const next = container.querySelector(`#${ghostId}`) as HTMLInputElement | null;
215+
next?.focus();
216+
});
211217
};
212218
ghostInput.addEventListener("keydown", (e) => {
213219
if (e.key === "Enter") { e.preventDefault(); commitGhostLane(); }
214220
});
215-
ghostInput.addEventListener("input", () => { commitGhostLane(); });
216-
ghostInput.addEventListener("blur", () => { commitGhostLane(); });
221+
ghostAddBtn?.addEventListener("click", () => { commitGhostLane(); });
217222
}
218223

219224
if (list && typeof Sortable !== "undefined") {

internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package version
88
//
99
// Convention: Update when releasing (e.g., "1.0.0", "1.1.0"); match git tags
1010
// (e.g., tag "v1.0.0" should have Version = "1.0.0").
11-
const Version = "3.5.6"
11+
const Version = "3.5.7"
1212

1313
// ExportFormatVersion is the version of the backup/export data format.
1414
// Only increment this when the ExportData structure changes in a breaking way.

0 commit comments

Comments
 (0)