chore(09-04): defer batch Update to Phase 9.1

- Remove Update button from batch select (not implemented)
- Document in STATE.md: batch update needs sub-workflow modularization
- Batch Start and Stop work; Update requires complex 5-step sequence

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-02-04 10:24:08 -05:00
parent 5a0d73cb98
commit 893a37e9c9
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -82,6 +82,10 @@ Phase 11: Documentation Overhaul [ ] Pending
(none) (none)
### Deferred to Phase 9.1
- **Batch Update via inline keyboard** — Route Batch Loop Action "update" output is not connected. The update sequence (pull→stop→remove→create→start) is too complex to inline in the batch loop. Will be trivial once workflow is modularized into sub-workflows.
## Session Continuity ## Session Continuity
- **Last session:** 2026-02-04 - **Last session:** 2026-02-04
+1 -1
View File
@@ -5538,7 +5538,7 @@
}, },
{ {
"parameters": { "parameters": {
"jsCode": "// Rebuild batch selection keyboard with updated checkmarks and pagination\nconst containers = $input.all();\n// Try to get data from Handle Batch Toggle, Prepare Batch Nav, or Handle Batch Clear\nlet toggleData;\ntry {\n toggleData = $(\"Handle Batch Toggle\").item.json;\n} catch (e) {\n try {\n toggleData = $(\"Prepare Batch Nav\").item.json;\n } catch (e2) {\n toggleData = $(\"Handle Batch Clear\").item.json;\n }\n}\nconst selectedCsv = toggleData.selectedCsv || '';\nconst selectedCount = toggleData.selectedCount || 0;\nconst chatId = toggleData.chatId;\nconst messageId = toggleData.messageId;\nconst queryId = toggleData.queryId;\nconst page = toggleData.batchPage || 0;\n\n// Parse selection\nconst selectedSet = new Set(selectedCsv ? selectedCsv.split(',') : []);\n\n// Extract container data\nlet allContainers = [];\nfor (const item of containers) {\n if (Array.isArray(item.json)) {\n allContainers = allContainers.concat(item.json);\n } else {\n allContainers.push(item.json);\n }\n}\n\n// Sort: running first, then alphabetically\nconst sortedContainers = allContainers\n .map(c => ({\n name: (c.Names && c.Names[0]) ? c.Names[0].replace(/^\\//, '') : 'unknown',\n state: c.State,\n id: c.Id.substring(0, 12)\n }))\n .sort((a, b) => {\n if (a.state === 'running' && b.state !== 'running') return -1;\n if (a.state !== 'running' && b.state === 'running') return 1;\n return a.name.localeCompare(b.name);\n });\n\n// Pagination: 6 containers per page\nconst containersPerPage = 6;\nconst totalPages = Math.ceil(sortedContainers.length / containersPerPage);\nconst start = page * containersPerPage;\nconst displayContainers = sortedContainers.slice(start, start + containersPerPage);\n\n// Build keyboard with checkmarks\nconst keyboard = displayContainers.map(c => {\n const isSelected = selectedSet.has(c.name);\n const icon = c.state === 'running' ? '\\u{1F7E2}' : '\\u26AA';\n const checkmark = isSelected ? '\\u2713 ' : '';\n return [\n {\n text: `${checkmark}${icon} ${c.name}`,\n callback_data: `batch:toggle:${page}:${selectedCsv}:${c.name}`\n }\n ];\n});\n\n// Add navigation row if needed - use batch:nav to preserve selection\nif (totalPages > 1) {\n const navRow = [];\n if (page > 0) {\n navRow.push({ text: '\\u25C0\\uFE0F Previous', callback_data: `batch:nav:${page - 1}:${selectedCsv}` });\n }\n navRow.push({ text: `${page + 1}/${totalPages}`, callback_data: 'noop' });\n if (page < totalPages - 1) {\n navRow.push({ text: 'Next \\u25B6\\uFE0F', callback_data: `batch:nav:${page + 1}:${selectedCsv}` });\n }\n keyboard.push(navRow);\n}\n\n// Add action buttons if selection exists\nif (selectedCount > 0) {\n keyboard.push([\n { text: `Start (${selectedCount})`, callback_data: `batch:exec:start:${selectedCsv}` },\n { text: `Stop (${selectedCount})`, callback_data: `batch:exec:stop:${selectedCsv}` },\n { text: `Update (${selectedCount})`, callback_data: `batch:exec:update:${selectedCsv}` }\n ]);\n keyboard.push([\n { text: 'Clear', callback_data: 'batch:clear' },\n { text: 'Cancel', callback_data: 'batch:cancel' }\n ]);\n} else {\n keyboard.push([\n { text: 'Cancel', callback_data: 'batch:cancel' }\n ]);\n}\n\nconst totalCount = sortedContainers.length;\nlet message = selectedCount > 0 \n ? `<b>Selected: ${selectedCount} container${selectedCount !== 1 ? 's' : ''}</b>\\n(Tap to select/deselect)`\n : '<b>Select containers for batch action:</b>\\n(Tap to select/deselect)';\nif (totalPages > 1) {\n message += `\\n\\nShowing ${start + 1}-${Math.min(start + containersPerPage, totalCount)} of ${totalCount}`;\n}\n\nreturn {\n json: {\n queryId: queryId,\n chatId: chatId,\n messageId: messageId,\n message: message,\n keyboard: {\n inline_keyboard: keyboard\n },\n selectedCsv: selectedCsv\n }\n};" "jsCode": "// Rebuild batch selection keyboard with updated checkmarks and pagination\nconst containers = $input.all();\n// Try to get data from Handle Batch Toggle, Prepare Batch Nav, or Handle Batch Clear\nlet toggleData;\ntry {\n toggleData = $(\"Handle Batch Toggle\").item.json;\n} catch (e) {\n try {\n toggleData = $(\"Prepare Batch Nav\").item.json;\n } catch (e2) {\n toggleData = $(\"Handle Batch Clear\").item.json;\n }\n}\nconst selectedCsv = toggleData.selectedCsv || '';\nconst selectedCount = toggleData.selectedCount || 0;\nconst chatId = toggleData.chatId;\nconst messageId = toggleData.messageId;\nconst queryId = toggleData.queryId;\nconst page = toggleData.batchPage || 0;\n\n// Parse selection\nconst selectedSet = new Set(selectedCsv ? selectedCsv.split(',') : []);\n\n// Extract container data\nlet allContainers = [];\nfor (const item of containers) {\n if (Array.isArray(item.json)) {\n allContainers = allContainers.concat(item.json);\n } else {\n allContainers.push(item.json);\n }\n}\n\n// Sort: running first, then alphabetically\nconst sortedContainers = allContainers\n .map(c => ({\n name: (c.Names && c.Names[0]) ? c.Names[0].replace(/^\\//, '') : 'unknown',\n state: c.State,\n id: c.Id.substring(0, 12)\n }))\n .sort((a, b) => {\n if (a.state === 'running' && b.state !== 'running') return -1;\n if (a.state !== 'running' && b.state === 'running') return 1;\n return a.name.localeCompare(b.name);\n });\n\n// Pagination: 6 containers per page\nconst containersPerPage = 6;\nconst totalPages = Math.ceil(sortedContainers.length / containersPerPage);\nconst start = page * containersPerPage;\nconst displayContainers = sortedContainers.slice(start, start + containersPerPage);\n\n// Build keyboard with checkmarks\nconst keyboard = displayContainers.map(c => {\n const isSelected = selectedSet.has(c.name);\n const icon = c.state === 'running' ? '\\u{1F7E2}' : '\\u26AA';\n const checkmark = isSelected ? '\\u2713 ' : '';\n return [\n {\n text: `${checkmark}${icon} ${c.name}`,\n callback_data: `batch:toggle:${page}:${selectedCsv}:${c.name}`\n }\n ];\n});\n\n// Add navigation row if needed - use batch:nav to preserve selection\nif (totalPages > 1) {\n const navRow = [];\n if (page > 0) {\n navRow.push({ text: '\\u25C0\\uFE0F Previous', callback_data: `batch:nav:${page - 1}:${selectedCsv}` });\n }\n navRow.push({ text: `${page + 1}/${totalPages}`, callback_data: 'noop' });\n if (page < totalPages - 1) {\n navRow.push({ text: 'Next \\u25B6\\uFE0F', callback_data: `batch:nav:${page + 1}:${selectedCsv}` });\n }\n keyboard.push(navRow);\n}\n\n// Add action buttons if selection exists\n// Note: Update deferred to Phase 9.1 (needs sub-workflow modularization)\nif (selectedCount > 0) {\n keyboard.push([\n { text: `Start (${selectedCount})`, callback_data: `batch:exec:start:${selectedCsv}` },\n { text: `Stop (${selectedCount})`, callback_data: `batch:exec:stop:${selectedCsv}` }\n ]);\n keyboard.push([\n { text: 'Clear', callback_data: 'batch:clear' },\n { text: 'Cancel', callback_data: 'batch:cancel' }\n ]);\n} else {\n keyboard.push([\n { text: 'Cancel', callback_data: 'batch:cancel' }\n ]);\n}\n\nconst totalCount = sortedContainers.length;\nlet message = selectedCount > 0 \n ? `<b>Selected: ${selectedCount} container${selectedCount !== 1 ? 's' : ''}</b>\\n(Tap to select/deselect)`\n : '<b>Select containers for batch action:</b>\\n(Tap to select/deselect)';\nif (totalPages > 1) {\n message += `\\n\\nShowing ${start + 1}-${Math.min(start + containersPerPage, totalCount)} of ${totalCount}`;\n}\n\nreturn {\n json: {\n queryId: queryId,\n chatId: chatId,\n messageId: messageId,\n message: message,\n keyboard: {\n inline_keyboard: keyboard\n },\n selectedCsv: selectedCsv\n }\n};"
}, },
"id": "code-rebuild-batch-select-keyboard", "id": "code-rebuild-batch-select-keyboard",
"name": "Rebuild Batch Select Keyboard", "name": "Rebuild Batch Select Keyboard",