diff --git a/.github/workflows/maintenance-tests.yml b/.github/workflows/maintenance-tests.yml index 816ffe0..908d506 100644 --- a/.github/workflows/maintenance-tests.yml +++ b/.github/workflows/maintenance-tests.yml @@ -38,11 +38,13 @@ jobs: npm run test:desktop-cli npm run test:card-ordering npm run test:list-actions + npm run test:editor-paths + npm run test:board-refresh npm run test:board-card-metadata - name: Prepare isolated Electron desktop run: | - sudo apt-get update - sudo apt-get install --yes xvfb openbox libnss3 libasound2t64 libgbm1 + sudo apt-get -o Acquire::Retries=1 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update + sudo apt-get -o Acquire::Retries=1 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 install --yes --no-install-recommends xvfb openbox libnss3 libasound2t64 libgbm1 sudo chown root:root node_modules/electron/dist/chrome-sandbox sudo chmod 4755 node_modules/electron/dist/chrome-sandbox - name: Electron regressions @@ -73,7 +75,7 @@ jobs: windows: if: ${{ !inputs.source_ref }} runs-on: windows-latest - timeout-minutes: 20 + timeout-minutes: 30 steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 @@ -86,8 +88,21 @@ jobs: run: npm run test:cli - name: List rename rollback regressions run: npm run test:list-actions - - name: Native Windows protocol, list actions and filtered drag regressions + - name: Editor path regressions + run: npm run test:editor-paths + - name: Board refresh regressions + run: npm run test:board-refresh + - name: Full native Windows Electron regressions env: # Explicit opt-in applies only to this disposable hosted Windows desktop. SIGNBOARD_PLAYWRIGHT_ALLOW_LOCAL: '1' - run: npx playwright test --grep 'card links|drags filtered cards|date-filtered card drops|list rename|moves lists left and right|adds a new list to the right' + run: npx playwright test + - name: Windows storage, automation and integration regressions + if: ${{ !cancelled() }} + shell: bash + run: | + failed=0 + for suite in maintenance mcp automation-parity desktop-cli card-ordering board-snapshot board-duplication archive obsidian-integration import-trello import-obsidian import-tasksmd app-settings update-release-notes update-errors packaging-config; do + npm run "test:$suite" || failed=1 + done + exit "$failed" diff --git a/AGENTS.md b/AGENTS.md index 63ced9f..f932284 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -98,3 +98,23 @@ CLI/MCP parity uses `lib/automation.js` for validated board relocation/duplicati ## List rename failure recovery List insertion and Move list left/right must use the main-process `reorderLists` transaction, like drag-and-drop. Never stage list renames in the renderer or reconcile card metadata against temporary names. `lib/listOrderRecovery.js` retries transient rename failures and records original/temporary/final names in an exclusively created, fsynced `.signboard-list-order.json` before staging. Successful commit or rollback removes it; incomplete recovery retains it and blocks further reorders. Do not overwrite this record or guess names for legacy `__sbtmp-*` directories. Failed insertion positioning retains the newly created list; the UI refreshes and reports the failure without a success announcement or duplicate submission. Keep `test:list-actions`, the Electron list-action regressions, and deferred external refresh aligned. + +## Windows editor paths — 1.7.7 + +Card snapshots and move results retain native filesystem paths. Normalize separators when deriving the editor list for comparison with renderer board roots; preserve the native path used for IPC/saving. Linked-note picker parents must retain UNC double slashes and the slash on drive roots. Keep `npm run test:editor-paths`, editor move Electron regressions, and the Windows maintenance workflow aligned. + +External board refresh must wait while a Table bulk menu is open so draft dates and label choices survive. Keep the forced-refresh bulk-date Electron regression in both Linux and Windows CI. + +Card drag/drop increments `window.cardOrderInProgress` through the transaction and watch acknowledgement, with `finally` cleanup for overlapping or failed drops. External sync defers token sampling during that interval (including a drop that starts during token IPC), while previously pending refreshes and later external edits remain deliverable. Keep `test:board-refresh` and the no-redraw/external-edit Electron regressions aligned. + +Windows maintenance CI runs the full Electron suite plus storage, archive, board duplication, import, Obsidian, CLI/MCP, and updater helper regressions on a disposable native Windows runner. Keep coverage aligned with Linux instead of restricting Windows to selected test titles. + +The renderer filename sanitizer also creates list folders. Sanitize the entire input before separating an extension so punctuation after a period cannot create Windows-invalid paths. `test:list-actions` loads the real sanitizer; the Electron suite covers dotted list names. + +`lib/directoryRename.js` allows case-only renames only when filesystem entry identities match; keep unrelated-destination rejection and metadata rollback intact. CLI list renames share that check. Planner filter menus constrain their height on open, content changes, and resize, with scrolling for all labels and Clear filters. Maintenance/Electron regressions cover both behaviors. + +Linux CI installs only the required Xvfb/Openbox dependencies, with bounded network retries and timeouts. + +Editor archive actions share one pending promise through final modal cleanup. Other modal transitions wait for it; archive cleanup bypasses its own wait. Preserve failure cleanup, duplicate-request handling, and the delayed-archive Electron regression. + +App settings save responses reconcile against the submitted snapshot: preserve newer renderer edits while accepting server-generated values for unchanged fields. Keep the deferred-save regression in `test:app-settings` and Smart Actions Electron coverage aligned. diff --git a/CODEX.md b/CODEX.md index faea3de..5ccc0a2 100644 --- a/CODEX.md +++ b/CODEX.md @@ -137,3 +137,23 @@ CLI/MCP parity uses `lib/automation.js` for validated board relocation/duplicati ## List rename failure recovery List insertion and Move list left/right must use the main-process `reorderLists` transaction, like drag-and-drop. Never stage list renames in the renderer or reconcile card metadata against temporary names. `lib/listOrderRecovery.js` retries transient rename failures and records original/temporary/final names in an exclusively created, fsynced `.signboard-list-order.json` before staging. Successful commit or rollback removes it; incomplete recovery retains it and blocks further reorders. Do not overwrite this record or guess names for legacy `__sbtmp-*` directories. Failed insertion positioning retains the newly created list; the UI refreshes and reports the failure without a success announcement or duplicate submission. Keep `test:list-actions`, the Electron list-action regressions, and deferred external refresh aligned. + +## Windows editor paths — 1.7.7 + +Card snapshots and move results retain native filesystem paths. Normalize separators when deriving the editor list for comparison with renderer board roots; preserve the native path used for IPC/saving. Linked-note picker parents must retain UNC double slashes and the slash on drive roots. Keep `npm run test:editor-paths`, editor move Electron regressions, and the Windows maintenance workflow aligned. + +External board refresh must wait while a Table bulk menu is open so draft dates and label choices survive. Keep the forced-refresh bulk-date Electron regression in both Linux and Windows CI. + +Card drag/drop increments `window.cardOrderInProgress` through the transaction and watch acknowledgement, with `finally` cleanup for overlapping or failed drops. External sync defers token sampling during that interval (including a drop that starts during token IPC), while previously pending refreshes and later external edits remain deliverable. Keep `test:board-refresh` and the no-redraw/external-edit Electron regressions aligned. + +Windows maintenance CI runs the full Electron suite plus storage, archive, board duplication, import, Obsidian, CLI/MCP, and updater helper regressions on a disposable native Windows runner. Keep coverage aligned with Linux instead of restricting Windows to selected test titles. + +The renderer filename sanitizer also creates list folders. Sanitize the entire input before separating an extension so punctuation after a period cannot create Windows-invalid paths. `test:list-actions` loads the real sanitizer; the Electron suite covers dotted list names. + +`lib/directoryRename.js` allows case-only renames only when filesystem entry identities match; keep unrelated-destination rejection and metadata rollback intact. CLI list renames share that check. Planner filter menus constrain their height on open, content changes, and resize, with scrolling for all labels and Clear filters. Maintenance/Electron regressions cover both behaviors. + +Linux CI installs only the required Xvfb/Openbox dependencies, with bounded network retries and timeouts. + +Editor archive actions share one pending promise through final modal cleanup. Other modal transitions wait for it; archive cleanup bypasses its own wait. Preserve failure cleanup, duplicate-request handling, and the delayed-archive Electron regression. + +App settings save responses reconcile against the submitted snapshot: preserve newer renderer edits while accepting server-generated values for unchanged fields. Keep the deferred-save regression in `test:app-settings` and Smart Actions Electron coverage aligned. diff --git a/app/appSettings.js b/app/appSettings.js index 4ca8077..bb4805c 100644 --- a/app/appSettings.js +++ b/app/appSettings.js @@ -1185,6 +1185,30 @@ function scheduleAppSettingsSave() { }, 250); } +function getEditableAppSettingsSnapshot() { + return { + notifications: getAppNotificationSettings(), + tooltipsEnabled: getAppTooltipsEnabled(), + quickAdd: getAppQuickAddSettings(), + appearance: getAppAppearanceSettings(), + externalPublishedCalendar: getAppExternalPublishedCalendarSettings(), + ai: getAppAiSettings(), + }; +} + +function preservePendingAppSettingChanges(requested, current, saved) { + if (JSON.stringify(current) === JSON.stringify(requested)) return saved; + if (current && requested && saved && typeof current === 'object' && + typeof requested === 'object' && typeof saved === 'object' && !Array.isArray(current)) { + const merged = { ...saved }; + for (const key of Object.keys(current)) { + merged[key] = preservePendingAppSettingChanges(requested[key], current[key], saved[key]); + } + return merged; + } + return current; +} + function persistAppSettings() { const state = getAppSettingsState(); @@ -1194,19 +1218,13 @@ function persistAppSettings() { return; } - const requestedAppearance = getAppAppearanceSettings(); - const result = await window.electronAPI.updateAppSettings({ - notifications: getAppNotificationSettings(), - tooltipsEnabled: getAppTooltipsEnabled(), - quickAdd: getAppQuickAddSettings(), - appearance: getAppAppearanceSettings(), - externalPublishedCalendar: getAppExternalPublishedCalendarSettings(), - ai: getAppAiSettings(), - }); - // A quick second mode selection must survive an older save response. - const currentAppearance = getAppAppearanceSettings(); - if (JSON.stringify(currentAppearance) !== JSON.stringify(requestedAppearance)) { - result.appearance = currentAppearance; + const requested = getEditableAppSettingsSnapshot(); + const result = await window.electronAPI.updateAppSettings(requested); + const current = getEditableAppSettingsSnapshot(); + // Preserve edits made during IPC without losing server-generated values, + // such as the published-calendar token, in fields the user did not edit. + for (const key of Object.keys(requested)) { + result[key] = preservePendingAppSettingChanges(requested[key], current[key], result[key]); } applyAppSettings(result); renderAppSettingsControls(); diff --git a/app/board/plannerView.js b/app/board/plannerView.js index f8af4d3..2d87d3d 100644 --- a/app/board/plannerView.js +++ b/app/board/plannerView.js @@ -1866,6 +1866,14 @@ function renderPlannerFilterPopover() { clearPlannerFilters(); }); popover.appendChild(clearButton); + constrainPlannerFilterPopover(); +} + +function constrainPlannerFilterPopover() { + const popover = document.getElementById('plannerFilterPopover'); + if (!popover || popover.classList.contains('hidden')) return; + const availableHeight = Math.max(0, window.innerHeight - popover.getBoundingClientRect().top - 8); + popover.style.maxHeight = `${Math.floor(availableHeight)}px`; } function closePlannerFilterPopover() { @@ -1989,6 +1997,7 @@ function togglePlannerFilterPopover() { popover.classList.toggle('hidden', !isHidden); popover.setAttribute('aria-hidden', isHidden ? 'false' : 'true'); if (isHidden) { + constrainPlannerFilterPopover(); focusPlannerFilterControl(0); } } @@ -2177,6 +2186,7 @@ function initializePlannerControls() { return; } + window.addEventListener('resize', constrainPlannerFilterPopover); const closeButton = document.getElementById('plannerCloseButton'); const filterButton = document.getElementById('plannerFilterButton'); const filterPopover = document.getElementById('plannerFilterPopover'); diff --git a/app/init.js b/app/init.js index dd82fab..36d82b7 100644 --- a/app/init.js +++ b/app/init.js @@ -288,9 +288,11 @@ function isBoardDragInProgress() { function isExternalBoardRefreshBlocked() { return isBoardDragInProgress() || Boolean(window.listOrderInProgress) + || Boolean(window.cardOrderInProgress) || (typeof isCardDatePopoverOpen === 'function' && isCardDatePopoverOpen()) || (typeof isCardLabelPopoverOpen === 'function' && isCardLabelPopoverOpen()) || (typeof isListActionsPopoverOpen === 'function' && isListActionsPopoverOpen()) + || Boolean(document.querySelector('#board.board-view-table .board-table-bulk-menu')) || isModalOpen('modalEditCard') || isModalOpen('modalBoardSettings') || isModalOpen('modalArchiveBrowser') @@ -983,11 +985,21 @@ async function externalBoardSyncTick() { return; } + // The drop handler updates paths in place and acknowledges its own + // watch events after the transaction. Do not queue a redundant refresh + // from those events while the asynchronous drop is still finishing. + if (window.cardOrderInProgress) { + return; + } + if (externalBoardRefreshPending && !isExternalBoardRefreshBlocked()) { scheduleExternalBoardRefresh(); } const latestToken = Number(await window.board.getBoardWatchToken()); + if (window.cardOrderInProgress) { + return; + } if (!Number.isFinite(latestToken) || latestToken <= externalBoardWatchToken) { return; } diff --git a/app/lists/createListElement.js b/app/lists/createListElement.js index 97e2c7d..bc37f4b 100644 --- a/app/lists/createListElement.js +++ b/app/lists/createListElement.js @@ -100,6 +100,7 @@ async function createListElement(name, listPath, cardNames, options = {}) { .map((card) => card.getAttribute('data-path')) .filter(Boolean); + window.cardOrderInProgress = (window.cardOrderInProgress || 0) + 1; try { if (!window.board || typeof window.board.reorderCardsInList !== 'function') { throw new Error('Card reorder is unavailable.'); @@ -129,6 +130,8 @@ async function createListElement(name, listPath, cardNames, options = {}) { announceSignboardStatus('Card order could not be saved.'); } await renderBoard(); + } finally { + window.cardOrderInProgress -= 1; } } })); diff --git a/app/modals/closeAllModals.js b/app/modals/closeAllModals.js index 77b8077..7e5bedb 100644 --- a/app/modals/closeAllModals.js +++ b/app/modals/closeAllModals.js @@ -136,6 +136,12 @@ async function closeAllModals(e, options = {}){ return; } + // Modal transitions must not overtake an archive's final editor cleanup. + // The archive itself skips this wait to avoid awaiting its own promise. + if (!options.skipEditorArchiveWait && typeof waitForEditorArchiveIfNeeded === 'function') { + await waitForEditorArchiveIfNeeded(); + } + if (!options.skipPlannerCardOpenWait && typeof getPlannerState === 'function') { const pendingOpen = getPlannerState().cardOpenPromise; if (pendingOpen) await pendingOpen.catch(() => {}); diff --git a/app/modals/toggleEditCardModal.js b/app/modals/toggleEditCardModal.js index 030fae4..0296522 100644 --- a/app/modals/toggleEditCardModal.js +++ b/app/modals/toggleEditCardModal.js @@ -780,13 +780,14 @@ async function recreateLinkedObsidianNoteForActiveCard(linkedObject) { function getLinkedObjectDefaultPickerPath(linkedObject = {}) { const filePath = String(linkedObject.path || '').replace(/\\/g, '/').trim(); - const parts = filePath.split('/').filter(Boolean); - if (parts.length <= 1) { + const lastSlash = filePath.lastIndexOf('/'); + if (lastSlash === -1) { return ''; } - const prefix = filePath.startsWith('/') ? '/' : ''; - return `${prefix}${parts.slice(0, -1).join('/')}`; + // Preserve UNC's leading // and keep drive roots absolute (C:/, not C:). + const parentPath = filePath.slice(0, lastSlash); + return /^[A-Za-z]:$/.test(parentPath) ? `${parentPath}/` : parentPath || '/'; } async function relinkLinkedObsidianNoteForActiveCard(linkedObject) { @@ -2765,7 +2766,9 @@ async function handleMetadataSave(value,metaName) { }; function getCardListPath(cardPath) { - const normalized = String(cardPath || ''); + // Snapshots and move results contain native Windows separators, while + // renderer board roots and dropdown values use forward slashes. + const normalized = String(cardPath || '').replace(/\\/g, '/'); const lastSlash = normalized.lastIndexOf('/'); if (lastSlash === -1) { return ''; @@ -3091,7 +3094,21 @@ async function handleChangeCardListSelect(e) { return; } -async function archiveActiveEditorCard() { +let activeEditorArchivePromise = null; + +function waitForEditorArchiveIfNeeded() { + return activeEditorArchivePromise; +} + +function archiveActiveEditorCard() { + if (activeEditorArchivePromise) return activeEditorArchivePromise; + activeEditorArchivePromise = performActiveEditorCardArchive().finally(() => { + activeEditorArchivePromise = null; + }); + return activeEditorArchivePromise; +} + +async function performActiveEditorCardArchive() { const cardEditorCardPath = document.getElementById('cardEditorCardPath'); const cardPath = cardEditorCardPath ? String(cardEditorCardPath.value || '').trim() : ''; if (!cardPath || !isCardEditorActive()) { @@ -3102,7 +3119,7 @@ async function archiveActiveEditorCard() { await window.board.archiveCard(cardPath); clearQueuedEditorSave(); cardEditorCardPath.value = ''; - await closeAllModals(createCloseAllModalsRequest()); + await closeAllModals(createCloseAllModalsRequest(), { skipEditorArchiveWait: true }); if (typeof announceSignboardStatus === 'function') { announceSignboardStatus('Archived card.'); } diff --git a/app/utilities/santizeFileName.js b/app/utilities/santizeFileName.js index 8440e58..4d0e788 100644 --- a/app/utilities/santizeFileName.js +++ b/app/utilities/santizeFileName.js @@ -1,4 +1,8 @@ async function sanitizeFileName(rawName) { + // Lists also use this helper: a period does not make the remaining text a + // trusted extension. Remove unsafe characters from the whole name first. + rawName = String(rawName || '').replace(/[^\p{L}\p{N}_\-. ]/gu, ''); + // 1. Split into base name + extension (if any) const lastDot = rawName.lastIndexOf('.'); const ext = (lastDot !== -1) ? rawName.slice(lastDot) : ''; diff --git a/config/build-info.json b/config/build-info.json index bbf16dd..349e5f5 100644 --- a/config/build-info.json +++ b/config/build-info.json @@ -1,11 +1,11 @@ { "schemaVersion": 1, - "version": "1.7.6", - "buildId": "20261104.2", + "version": "1.7.7", + "buildId": "20261111.4", "channel": "release", - "builtAt": "2026-11-04T12:02:23.345Z", - "sourceFingerprint": "92f73f741ea7720551c041f188bac949c06a2403f9b22d8e1c60b8a367d08f70", - "sourceFileCount": 175, - "commit": "8ecf66e40e976c000f0fb56b68d12a1af1939634", + "builtAt": "2026-11-11T15:09:58.648Z", + "sourceFingerprint": "b36621c24a6fb0f9bc164088203fd26e85788b45b56635f99c8d75588cf6f5b9", + "sourceFileCount": 177, + "commit": "b971c0a6c2d2876e739d1438815cea929bb8dc8d", "dirty": true } diff --git a/docs/README.md b/docs/README.md index 7bb07cb..4bce119 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ Signboard stores boards as folders and cards as Markdown files. These guides describe the 1.7.x app and its automation interfaces. -The upcoming 1.7.6 update closes gaps between the CLI and MCP for archiving, card queries, list and board management, settings, and persisted ordering. See the [1.7.6 release notes](./releases/1.7.6.md). +The upcoming 1.7.7 update fixes Windows card-editor moves and the starting folder for relinking missing Obsidian notes on network shares or drive roots. It also preserves Table bulk-edit drafts during filesystem refreshes. See the [1.7.7 release notes](./releases/1.7.7.md). Dotted list names also remove Windows-invalid punctuation correctly; capitalization-only renames and scrolling Planner filters work on smaller Windows desktops. ## Choose a guide diff --git a/docs/build-identity.md b/docs/build-identity.md index c024ecc..9d9db03 100644 --- a/docs/build-identity.md +++ b/docs/build-identity.md @@ -1,6 +1,6 @@ # Build identity -The release version is `1.7.5`; build identity is separate from updater versions. Each prepared source snapshot gets a separate build such as `20260917.1`, using the UTC date and the next sequence after the previous stamp for that date. The Mac and Linux packages reuse the same stamp. Treat the build ID plus source fingerprint as the identity; different branches/checkouts can otherwise independently allocate the same daily sequence. +The release version is `1.7.7`; build identity is separate from updater versions. Each prepared source snapshot gets a separate build such as `20260917.1`, using the UTC date and the next sequence after the previous stamp for that date. All platform packages reuse the same stamp. Treat the build ID plus source fingerprint as the identity; different branches/checkouts can otherwise independently allocate the same daily sequence. ## Prepare once, build on every platform diff --git a/docs/codex/FILE_STRUCTURE.md b/docs/codex/FILE_STRUCTURE.md index b09cbc0..07ea685 100644 --- a/docs/codex/FILE_STRUCTURE.md +++ b/docs/codex/FILE_STRUCTURE.md @@ -224,3 +224,23 @@ This map focuses on source and operational files. Large generated/vendor folders - `lib/listOrderRecovery.js` — bounded list-rename retries and an exclusive recovery record preserving original, temporary, and final folder names. - `scripts/test-list-actions.js` — real-filesystem renderer action regressions for insertion and left/right moves, staging/final failures, retries, card/settings preservation, and incomplete recovery. Run with `npm run test:list-actions`. + +## Windows editor path coverage + +- `app/modals/toggleEditCardModal.js` — separator-aware list lookup for editor moves and UNC/drive-root-preserving linked-note picker parents. +- `scripts/test-editor-paths.js` — actual renderer handlers exercised with POSIX, Windows, mixed-separator, and UNC paths, including repeat moves, boundary no-ops, failures, and picker roots. +- `tests/playwright/signboard-smoke.spec.js` — native editor dropdown/arrow/shortcut moves and saving after repeated moves; included in Windows maintenance CI alongside Table list moves. +- `app/init.js` — defers external board refresh during Table bulk-menu edits; refresh resumes through the existing pending-watch lifecycle after the menu closes. +- `scripts/test-board-refresh.js` — token IPC/drop races, pending external refresh preservation, bulk-menu guards, and overlapping/failed drop cleanup. + +Windows maintenance CI runs the full Electron suite plus storage, archive, board duplication, import, Obsidian, CLI/MCP, and updater helper regressions on a disposable native Windows runner. Keep coverage aligned with Linux instead of restricting Windows to selected test titles. + +The renderer filename sanitizer also creates list folders. Sanitize the entire input before separating an extension so punctuation after a period cannot create Windows-invalid paths. `test:list-actions` loads the real sanitizer; the Electron suite covers dotted list names. + +`lib/directoryRename.js` allows case-only renames only when filesystem entry identities match; keep unrelated-destination rejection and metadata rollback intact. CLI list renames share that check. Planner filter menus constrain their height on open, content changes, and resize, with scrolling for all labels and Clear filters. Maintenance/Electron regressions cover both behaviors. + +Linux CI installs only the required Xvfb/Openbox dependencies, with bounded network retries and timeouts. + +Editor archive actions share one pending promise through final modal cleanup. Other modal transitions wait for it; archive cleanup bypasses its own wait. Preserve failure cleanup, duplicate-request handling, and the delayed-archive Electron regression. + +App settings save responses reconcile against the submitted snapshot: preserve newer renderer edits while accepting server-generated values for unchanged fields. Keep the deferred-save regression in `test:app-settings` and Smart Actions Electron coverage aligned. diff --git a/docs/codex/PLAYWRIGHT_TESTING.md b/docs/codex/PLAYWRIGHT_TESTING.md index 6d2543e..5a91ee4 100644 --- a/docs/codex/PLAYWRIGHT_TESTING.md +++ b/docs/codex/PLAYWRIGHT_TESTING.md @@ -49,4 +49,6 @@ The worker sets `SHARP_IGNORE_GLOBAL_LIBVIPS=1` when installing dependencies so ## Pull request checks -The Maintenance regressions workflow runs the full Electron suite on a disposable GitHub-hosted Linux Xvfb/Openbox desktop and focused protocol/filtered-drag tests on a disposable Windows runner. Windows explicitly opts into its own test desktop. This does not authorize foreground tests on a contributor's working Mac. Test diagnostics remain local to the runner; public PRs summarize results rather than uploading research reports. +The Maintenance regressions workflow runs the full Electron suite on a disposable GitHub-hosted Linux Xvfb/Openbox desktop and the full Electron suite and storage/integration regressions on a disposable Windows runner. Windows explicitly opts into its own test desktop. This does not authorize foreground tests on a contributor's working Mac. Test diagnostics remain local to the runner; public PRs summarize results rather than uploading research reports. + +Board fixtures set a shared 1280×860 viewport across platforms; compact-layout tests resize explicitly. Assertions distinguish normalized renderer paths from native filesystem paths. diff --git a/docs/codex/PROJECT_CONTEXT.md b/docs/codex/PROJECT_CONTEXT.md index 97eb5e6..f3ac6cb 100644 --- a/docs/codex/PROJECT_CONTEXT.md +++ b/docs/codex/PROJECT_CONTEXT.md @@ -646,3 +646,23 @@ CLI/MCP parity uses `lib/automation.js` for validated board relocation/duplicati ## List rename failure recovery List insertion and Move list left/right must use the main-process `reorderLists` transaction, like drag-and-drop. Never stage list renames in the renderer or reconcile card metadata against temporary names. `lib/listOrderRecovery.js` retries transient rename failures and records original/temporary/final names in an exclusively created, fsynced `.signboard-list-order.json` before staging. Successful commit or rollback removes it; incomplete recovery retains it and blocks further reorders. Do not overwrite this record or guess names for legacy `__sbtmp-*` directories. Failed insertion positioning retains the newly created list; the UI refreshes and reports the failure without a success announcement or duplicate submission. Keep `test:list-actions`, the Electron list-action regressions, and deferred external refresh aligned. + +## Windows editor paths — 1.7.7 + +Card snapshots and move results retain native filesystem paths. Normalize separators when deriving the editor list for comparison with renderer board roots; preserve the native path used for IPC/saving. Linked-note picker parents must retain UNC double slashes and the slash on drive roots. Keep `npm run test:editor-paths`, editor move Electron regressions, and the Windows maintenance workflow aligned. + +External board refresh must wait while a Table bulk menu is open so draft dates and label choices survive. Keep the forced-refresh bulk-date Electron regression in both Linux and Windows CI. + +Card drag/drop increments `window.cardOrderInProgress` through the transaction and watch acknowledgement, with `finally` cleanup for overlapping or failed drops. External sync defers token sampling during that interval (including a drop that starts during token IPC), while previously pending refreshes and later external edits remain deliverable. Keep `test:board-refresh` and the no-redraw/external-edit Electron regressions aligned. + +Windows maintenance CI runs the full Electron suite plus storage, archive, board duplication, import, Obsidian, CLI/MCP, and updater helper regressions on a disposable native Windows runner. Keep coverage aligned with Linux instead of restricting Windows to selected test titles. + +The renderer filename sanitizer also creates list folders. Sanitize the entire input before separating an extension so punctuation after a period cannot create Windows-invalid paths. `test:list-actions` loads the real sanitizer; the Electron suite covers dotted list names. + +`lib/directoryRename.js` allows case-only renames only when filesystem entry identities match; keep unrelated-destination rejection and metadata rollback intact. CLI list renames share that check. Planner filter menus constrain their height on open, content changes, and resize, with scrolling for all labels and Clear filters. Maintenance/Electron regressions cover both behaviors. + +Linux CI installs only the required Xvfb/Openbox dependencies, with bounded network retries and timeouts. + +Editor archive actions share one pending promise through final modal cleanup. Other modal transitions wait for it; archive cleanup bypasses its own wait. Preserve failure cleanup, duplicate-request handling, and the delayed-archive Electron regression. + +App settings save responses reconcile against the submitted snapshot: preserve newer renderer edits while accepting server-generated values for unchanged fields. Keep the deferred-save regression in `test:app-settings` and Smart Actions Electron coverage aligned. diff --git a/docs/releases/1.7.7.md b/docs/releases/1.7.7.md new file mode 100644 index 0000000..67479d2 --- /dev/null +++ b/docs/releases/1.7.7.md @@ -0,0 +1,16 @@ +# Signboard 1.7.7 + +## Fixes + +- Fixed older settings save responses overwriting newer changes, including newly added custom Smart Actions. + +- Fixed opening Archive immediately after archiving a card: the completed archive action no longer closes the newly opened browser. + +- Fixed Windows card-editor list dropdowns reverting to the first list instead of moving the card. The next/previous-list arrow and keyboard shortcuts now handle native Windows card paths too. +- Fixed creating lists with names such as `Release 1.7: QA` on Windows by removing invalid folder-name punctuation after periods. +- Fixed board and list renames that change only capitalization on Windows and other case-insensitive filesystems. +- Kept Planner filters and Clear filters reachable in smaller windows and boards with many labels. +- Fixed the starting folder for relinking missing Obsidian notes on Windows network shares and drive roots. +- Fixed a cross-platform race where a filesystem refresh could close a Table bulk-edit menu and discard draft dates or label selections. Refresh waits until the menu closes. +- Prevented an unnecessary full-board redraw when filesystem notifications race a card drop; later external edits still refresh normally. +- Added cross-platform path regressions and expanded native Windows CI to the full Electron suite plus storage, import, archive, and CLI/MCP regressions. diff --git a/docs/signboard-cli.md b/docs/signboard-cli.md index e6ce32c..9ead994 100644 --- a/docs/signboard-cli.md +++ b/docs/signboard-cli.md @@ -551,3 +551,5 @@ Explicit reorders must name every current item exactly once. Use returned paths See [CLI/MCP board operations](./automation.md) for the full parity matrix, settings JSON examples, destination rules, and ordering behavior. These mutation commands execute immediately. List ordering shares desktop rename retries and rollback. If an incomplete reorder leaves `.signboard-list-order.json`, preserve it with a board backup before recovery; subsequent list reorders will fail until the record is resolved. + +List and board rename commands support capitalization-only changes on case-insensitive filesystems, while still rejecting a distinct existing destination. diff --git a/docs/using-signboard.md b/docs/using-signboard.md index 9394cae..7729728 100644 --- a/docs/using-signboard.md +++ b/docs/using-signboard.md @@ -138,7 +138,9 @@ Drag a card between lists in Kanban view. You can also move it from the card edi While dragging, the board shows an empty insertion slot where the card would land; the card is moved only after you drop it. You can reorder cards or move them between lists while label, date, or search filters are active. Hidden cards retain their relative order. With a date filter active, a card moved into a completed list disappears from the filtered view while keeping its dates. -The list dropdown, arrow action, and card move keyboard shortcuts in the editor place moved cards at the top of the destination list. +The list dropdown, arrow action, and card move keyboard shortcuts in the editor place moved cards at the top of the destination list. Successful Kanban drops update the moved cards in place while filesystem notifications from that move settle. + +Starting with 1.7.7, these editor controls correctly recognize native Windows paths, including cards on network shares, and keep the current list selected after a move. ### Duplicate a card @@ -162,6 +164,8 @@ The same paperclip menu can link local files, folders, web URLs, app deep links, Linked objects appear in the card editor as removable chips. Click the object name to open it, or click its remove control to unlink it from the card without deleting the underlying file, folder, or note. If a linked Obsidian note cannot be found, Signboard keeps the link, marks the chip as missing, and offers controls to recreate the note, relink it to another Markdown note, or remove the link. Cards with linked objects also show a small paperclip count in Kanban and Table views. +The relink picker starts in the previous note's parent folder, preserving Windows drive roots and network-share paths. + New or edited cards include flat Obsidian-friendly properties such as `title`, `signboard_id`, `signboard_board`, `signboard_list`, `status`, `signboard_uri`, and `related`, plus structured `linked_objects` when the card has linked files, folders, URLs, app links, or Obsidian notes. The CLI maintains these properties when it creates, duplicates, edits, adds notes to, or moves cards, so those cards remain visible in the board's managed Obsidian Base. When a board is inside a vault, Signboard automatically creates `Signboard Board.base` for Obsidian Bases and keeps it current while it is still Signboard-managed. If you customize the Base in Obsidian, Signboard leaves it alone until you choose `Settings > Obsidian > Generate Base` again. Signboard also includes an optional desktop-only Obsidian companion plugin in `obsidian-plugin/`. Copy or symlink that folder into your vault as `.obsidian/plugins/signboard-companion` and enable it from Obsidian's Community plugins settings. The plugin can open and copy Signboard links, attach the active Obsidian note to a Signboard card, open cards by `obsidian://signboard?cardId=...`, and add a folder context-menu action named `Create Signboard`. That action asks first, then adds board metadata/list folders, treats existing child folders as lists, moves top-level Markdown notes into a To-do list, and opens the board in Signboard. When you delete an Obsidian note that is linked from Signboard cards, the plugin asks before removing those linked objects from the cards. @@ -249,6 +253,8 @@ When a board has more lists than fit the window, you can drag the empty board su Table is an active-board view for scanning and bulk-managing cards in board/list order. It uses the same board search, label filters, date filters, task progress badges, linked-object counts, and completed-list workflow rules as Kanban. +Filesystem refreshes wait while a bulk-edit menu is open, preserving unfinished date and label selections until you apply or close the menu. + Use the bottom view dock to switch to Table. Click a card title or row to open the normal card editor. Use the row's list dropdown to move a card to another list; moved cards land at the top of the destination list. Table includes `Start`, `Due`, `Updated`, and `Created` columns plus list filtering and sorting. Filter to one list, all completed lists, or all lists. Sort by `Updated, oldest first` to find cards you have not touched in a while, or by `Created, oldest first` to find your oldest cards. Search and filters apply first, then the Table sort orders the visible cards. @@ -327,7 +333,7 @@ Archiving removes things from the active board without deleting them. ### Archive a card -Open the card editor and choose the archive action. +Open the card editor and choose the archive action. Opening another panel immediately afterward waits for archiving and editor cleanup to finish. ### Archive all cards in a list @@ -362,6 +368,8 @@ Open `Settings` from the board menu or press `Cmd/Ctrl + ,`. ### App Settings +Settings edits made while an earlier save is finishing are retained and included in the next save, including newly created custom Smart Actions. + The `App Settings` group controls settings that apply across Signboard: - `General`: tooltips and the optional global Quick Add shortcut while Signboard is open @@ -522,3 +530,7 @@ You can also open the shortcut helper from `Help > Keyboard Shortcuts`. ## CLI and MCP board operations The CLI and MCP support archiving/restoration, filtered card queries, list renaming, board settings updates, board rename/move/duplication, and persisted card/list ordering. See the [operation matrix and examples](./automation.md). + +List folder names remove Windows-invalid punctuation throughout the name, including after periods; for example, `Release 1.7: QA` becomes `Release 1.7 QA`. + +Board and list names can be renamed by changing only their capitalization. Planner filter menus scroll when needed so every label and Clear filters remain reachable in smaller windows. diff --git a/lib/cliBoard.js b/lib/cliBoard.js index 341203d..fa2b5c7 100644 --- a/lib/cliBoard.js +++ b/lib/cliBoard.js @@ -484,10 +484,7 @@ async function renameList(boardRoot, listRef, newName) { } const nextPath = path.join(resolvedBoardRoot, nextDirectoryName); - if (await pathExists(nextPath)) { - throw new Error(`A list already exists at ${nextDirectoryName}`); - } - + // The shared helper distinguishes a real collision from a case-only rename. await renameManagedDirectory(resolvedBoardRoot, listEntry.path, nextPath); return { diff --git a/lib/directoryRename.js b/lib/directoryRename.js index bbbe1ec..30263e7 100644 --- a/lib/directoryRename.js +++ b/lib/directoryRename.js @@ -29,10 +29,17 @@ async function renameManagedDirectory(boardRoot, sourcePath, destinationPath) { if (!movingBoard && (path.dirname(sourcePath) !== boardRoot || path.dirname(destinationPath) !== boardRoot)) { throw new Error('A renamed list must remain directly inside its board.'); } - if ((await fs.lstat(sourcePath)).isSymbolicLink()) throw new Error('Cannot rename a linked directory.'); + const sourceEntry = await fs.lstat(sourcePath, { bigint: true }); + if (sourceEntry.isSymbolicLink()) throw new Error('Cannot rename a linked directory.'); try { - await fs.lstat(destinationPath); - throw new Error(`Destination already exists: ${destinationPath}`); + const destinationEntry = await fs.lstat(destinationPath, { bigint: true }); + const caseOnly = path.dirname(sourcePath) === path.dirname(destinationPath) + && path.basename(sourcePath).toLowerCase() === path.basename(destinationPath).toLowerCase(); + // On Windows and default macOS volumes both spellings name the same entry. + // Only permit that exact entry; a distinct destination remains a collision. + const sameEntry = sourceEntry.ino !== 0n && sourceEntry.ino === destinationEntry.ino + && sourceEntry.dev === destinationEntry.dev; + if (!caseOnly || !sameEntry) throw new Error(`Destination already exists: ${destinationPath}`); } catch (error) { if (error.code !== 'ENOENT') throw error; } diff --git a/package-lock.json b/package-lock.json index 592b09c..34ad720 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "signboard", - "version": "1.7.6", + "version": "1.7.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "signboard", - "version": "1.7.6", + "version": "1.7.7", "license": "MIT", "dependencies": { "electron-updater": "^6.8.3", diff --git a/package.json b/package.json index 56c162c..6eaca35 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "signboard", "productName": "Signboard", - "version": "1.7.6", + "version": "1.7.7", "description": "A fast, local-first Kanban board for Markdown files.", "homepage": "https://github.com/cdevroe/signboard", "repository": { @@ -110,7 +110,9 @@ "build:stamp": "npm run build:js && node scripts/stamp-build.js", "build:check": "node scripts/stamp-build.js --check", "test:build-info": "node scripts/test-build-info.js", - "test:list-actions": "node scripts/test-list-actions.js" + "test:list-actions": "node scripts/test-list-actions.js", + "test:editor-paths": "node scripts/test-editor-paths.js", + "test:board-refresh": "node scripts/test-board-refresh.js" }, "devDependencies": { "@fiahfy/icns": "^0.0.7", diff --git a/readme.md b/readme.md index a63f25b..6db4557 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,8 @@ Signboard is a local-first desktop kanban app that stores your lists as directories and cards as Markdown files on disk. +The upcoming [1.7.7 maintenance update](./docs/releases/1.7.7.md) fixes Windows card-editor moves and Obsidian-note relink picker paths, and preserves Table bulk-edit drafts during filesystem refreshes. Dotted list names also remove Windows-invalid punctuation correctly; capitalization-only renames and scrolling Planner filters work on smaller Windows desktops. + Signboard is free for personal use. If you are using Signboard for your work, it would be appreciated if you make the commercial-use sponsorship payment to support future development. See the app's "Sponsor" button. Signboard is over 1 year old now. Starting in Signboard 2.0.0 there will be Pro-only features. Signboard Pro will cost $49/year. diff --git a/scripts/test-app-settings.js b/scripts/test-app-settings.js index ad2f2e1..7729bc6 100644 --- a/scripts/test-app-settings.js +++ b/scripts/test-app-settings.js @@ -2,6 +2,7 @@ const assert = require('assert'); const fs = require('fs').promises; const os = require('os'); const path = require('path'); +const vm = require('node:vm'); const { DEFAULT_SMART_CARD_ACTIONS, @@ -40,7 +41,53 @@ function assertDefaultSmartCardActions(actions) { assert.strictEqual(questionAction.type, 'question'); } +async function testPendingRendererSettings() { + let release; + let started; + const requestStarted = new Promise((resolve) => { started = resolve; }); + const requests = []; + const context = vm.createContext({ + console, setTimeout: () => 1, clearTimeout: () => {}, + localStorage: { getItem: () => 'light' }, + window: { electronAPI: { updateAppSettings: async (settings) => { + const snapshot = JSON.parse(JSON.stringify(settings)); + requests.push(snapshot); + if (requests.length === 1) { + started(); + await new Promise((resolve) => { release = resolve; }); + } + return { ...snapshot, externalPublishedCalendar: { ...snapshot.externalPublishedCalendar, token: 'server-generated-token' } }; + } } }, + }); + for (const filename of ['shared/appSettingsSchema.js', 'app/appSettings.js']) { + vm.runInContext(await fs.readFile(path.join(__dirname, '..', filename), 'utf8'), context); + } + context.renderAppSettingsControls = () => {}; + context.setAppAppearanceSettings({ mode: 'light', themeSource: 'signboard' }); + const pending = context.persistAppSettings(); + await requestStarted; + context.addAppSmartCardAction(); + context.setAppTooltipsEnabled(false); + context.setAppNotificationSettings({ enabled: true, time: '10:30' }); + context.setAppQuickAddSettings({ globalShortcut: 'Control+Alt+N' }); + context.setAppAppearanceSettings({ mode: 'dark', themeSource: 'signboard' }); + context.setAppExternalPublishedCalendarSettings({ enabled: true, port: 48274, token: '' }); + release(); + await pending; + assert.strictEqual(context.getAppAiSettings().smartCardActions[0].label, 'Custom action 1', 'Older saves must not discard newly added Smart Actions'); + assert.strictEqual(context.getAppTooltipsEnabled(), false); + assert.strictEqual(context.getAppNotificationSettings().time, '10:30'); + assert.strictEqual(context.getAppQuickAddSettings().globalShortcut, 'Control+Alt+N'); + assert.strictEqual(context.getAppAppearanceSettings().mode, 'dark'); + assert.strictEqual(context.getAppExternalPublishedCalendarSettings().port, 48274); + assert.strictEqual(context.getAppExternalPublishedCalendarSettings().token, 'server-generated-token', 'Unedited server-generated fields must survive'); + await context.flushAppSettingsSave(); + assert.strictEqual(requests[1].ai.smartCardActions[0].label, 'Custom action 1', 'Follow-up save must persist the newer action'); + assert.strictEqual(requests[1].externalPublishedCalendar.token, 'server-generated-token'); +} + async function run() { + await testPendingRendererSettings(); const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'signboard-app-settings-')); try { diff --git a/scripts/test-board-refresh.js b/scripts/test-board-refresh.js new file mode 100644 index 0000000..aac2397 --- /dev/null +++ b/scripts/test-board-refresh.js @@ -0,0 +1,108 @@ +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); + +function fixture() { + let token = 1; + let scheduled = 0; + let renders = 0; + let bulkMenu = false; + const context = vm.createContext({ + console, + window: { + boardRoot: '/board/', cardOrderInProgress: 0, + board: { startBoardWatch: async () => ({ ok: true }), getBoardWatchToken: async () => token }, + setTimeout: () => ++scheduled, + }, + document: { getElementById: () => null, querySelector: () => bulkMenu ? {} : null }, + renderBoard: async () => { renders++; }, + }); + // Load the real lifecycle functions without booting the application. + const source = fs.readFileSync(path.join(__dirname, '../app/init.js'), 'utf8'); + assert.match(source, /\ninit\(\);\s*$/); + vm.runInContext(source.replace(/\ninit\(\);\s*$/, ''), context); + vm.runInContext("externalBoardWatchRoot = '/board/'; externalBoardWatchToken = 1;", context); + return { + context, + setToken: (value) => { token = value; }, + setBulkMenu: (value) => { bulkMenu = value; }, + scheduled: () => scheduled, + renders: () => renders, + }; +} + +async function main() { + { + const f = fixture(); + f.context.window.cardOrderInProgress = 1; + f.setToken(2); + await f.context.externalBoardSyncTick(); + assert.equal(f.scheduled(), 0, 'Do not schedule a redraw for a drop still writing'); + vm.runInContext('externalBoardWatchToken = 2;', f.context); // Drop acknowledges its completed writes. + f.context.window.cardOrderInProgress = 0; + await f.context.externalBoardSyncTick(); + assert.equal(f.scheduled(), 0); + + f.setToken(3); // A later external edit must still refresh. + await f.context.externalBoardSyncTick(); + assert.equal(f.scheduled(), 1); + await f.context.runExternalBoardRefresh(); + assert.equal(f.renders(), 1); + } + { + const f = fixture(); + let resolveToken; + f.context.window.board.getBoardWatchToken = () => new Promise((resolve) => { resolveToken = resolve; }); + const tick = f.context.externalBoardSyncTick(); + f.context.window.cardOrderInProgress = 1; + resolveToken(2); + await tick; + assert.equal(f.scheduled(), 0, 'A drop starting during the token IPC must also defer refresh'); + assert.equal(vm.runInContext('externalBoardWatchToken', f.context), 1); + } + for (const blocker of ['drop', 'bulk menu']) { + const f = fixture(); + if (blocker === 'drop') f.context.window.cardOrderInProgress = 1; + else f.setBulkMenu(true); + await f.context.runExternalBoardRefresh(); + assert.equal(f.renders(), 0); + assert.equal(vm.runInContext('externalBoardRefreshPending', f.context), true); + f.context.window.cardOrderInProgress = 0; + f.setBulkMenu(false); + await f.context.externalBoardSyncTick(); + assert.equal(f.scheduled(), 1, `Preserve refreshes already pending before the ${blocker}`); + await f.context.runExternalBoardRefresh(); + assert.equal(f.renders(), 1); + assert.equal(vm.runInContext('externalBoardRefreshPending', f.context), false); + } + { + const f = fixture(); + const writes = []; + let drop; + f.context.document.createElement = () => ({ + dataset: {}, setAttribute() {}, addEventListener() {}, appendChild() {}, querySelectorAll: () => [], + }); + f.context.Sortable = function (element, options) { drop = options.onEnd; }; + f.context.createBoardCardSortableOptions = (options) => options; + f.context.acknowledgeLocalBoardFilesystemChanges = async () => {}; + f.context.console = { error() {} }; + f.context.window.board.reorderCardsInList = () => new Promise((resolve, reject) => writes.push({ resolve, reject })); + vm.runInContext(fs.readFileSync(path.join(__dirname, '../app/lists/createListElement.js'), 'utf8'), f.context); + await f.context.createListElement('Inbox', '/board/inbox', []); + const event = { to: { dataset: { path: '/board/inbox' }, querySelectorAll: () => [] } }; + const first = drop(event); + const second = drop(event); + assert.equal(f.context.window.cardOrderInProgress, 2); + writes[0].resolve({ cards: [] }); + await first; + assert.equal(f.context.window.cardOrderInProgress, 1, 'Finishing one drop must not unlock another'); + writes[1].reject(new Error('Injected reorder failure')); + await second; + assert.equal(f.context.window.cardOrderInProgress, 0, 'Failed drops must release the refresh guard'); + assert.equal(f.renders(), 1, 'Failed drops still render recovery state'); + } + console.log('Board refresh regressions passed (drop/token races, pending refreshes, bulk menus, later external edits).'); +} + +main().catch((error) => { console.error(error); process.exitCode = 1; }); diff --git a/scripts/test-editor-paths.js b/scripts/test-editor-paths.js new file mode 100644 index 0000000..721ee5f --- /dev/null +++ b/scripts/test-editor-paths.js @@ -0,0 +1,163 @@ +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); + +const source = fs.readFileSync(path.join(__dirname, '../app/modals/toggleEditCardModal.js'), 'utf8'); +const lists = ['000-Inbox-stock', '001-Doing-stock', '002-Done-stock']; + +function fixture(root, nativePath) { + const card = { value: '' }; + const select = { + value: '', disabled: false, options: [], + set innerHTML(value) { this.options = []; this.value = ''; }, + appendChild(option) { + this.options.push(option); + if (option.selected || this.options.length === 1) this.value = option.value; + }, + }; + const arrow = { dataset: {}, setAttribute() {} }; + const moves = []; + const context = vm.createContext({ + console, + window: { boardRoot: root, board: { + listLists: async () => lists, + moveCardToTop: async (from, to) => { + moves.push({ from, to }); + return { cardPath: nativePath(`${to}/000-example-stock.md`) }; + }, + } }, + document: { + getElementById: (id) => ({ cardEditorCardPath: card, cardEditorListSelect: select, cardEditorMoveListLink: arrow })[id] || null, + createElement: () => ({}), + }, + }); + vm.runInContext(source, context); + context.isCardEditorActive = () => true; + context.flushEditorSaveIfNeeded = async () => {}; + context.showCardEditorListMoveFeedback = () => {}; + context.refreshCardEditorAfterMove = async (nextPath) => { + card.value = nextPath; + await context.updateCardEditorListDropdown(nextPath); + await context.updateCardEditorMoveLink(nextPath); + }; + const cardIn = (index) => nativePath(`${root}${lists[index]}/000-example-stock.md`); + const reset = async (index) => { + card.value = cardIn(index); + moves.length = 0; + await context.updateCardEditorListDropdown(card.value); + }; + return { context, card, select, arrow, moves, cardIn, reset }; +} + +async function testMoves(root, nativePath) { + const { context, card, select, arrow, moves, cardIn, reset } = fixture(root, nativePath); + const event = { currentTarget: select, stopPropagation() {}, preventDefault() {} }; + + // Opening a card outside Inbox must select its actual list, without a move. + await reset(1); + assert.equal(select.value, root + lists[1]); + await context.handleChangeCardListSelect(event); + assert.equal(moves.length, 0, 'Selecting the current list must not move the card'); + + select.value = root + lists[2]; + await context.handleChangeCardListSelect(event); + assert.deepEqual(moves, [{ from: cardIn(1), to: root + lists[2] }]); + assert.equal(card.value, cardIn(2), 'Keep the native path returned by the main process'); + assert.equal(select.value, root + lists[2]); + assert.equal(select.disabled, false); + assert.equal(arrow.dataset.direction, 'left'); + + // A second move uses the native path returned by the first one. + await context.handleClickMoveCard(event); + assert.equal(moves.length, 2); + assert.deepEqual(moves[1], { from: cardIn(2), to: root + lists[1] }); + assert.equal(select.value, root + lists[1]); + assert.equal(arrow.dataset.direction, 'right'); + await context.handleClickMoveCard(event); + assert.equal(card.value, cardIn(2)); + + await reset(0); + assert.equal(await context.moveActiveEditorCardToAdjacentList('left'), false); + assert.equal(moves.length, 0); + assert.equal(await context.moveActiveEditorCardToAdjacentList('right'), true); + assert.equal(card.value, cardIn(1)); + assert.equal(await context.moveActiveEditorCardToAdjacentList('left'), true); + assert.equal(card.value, cardIn(0)); + await reset(2); + assert.equal(await context.moveActiveEditorCardToAdjacentList('right'), false); + assert.equal(moves.length, 0); + + // A failed write keeps the source selection and restores the control. + await reset(1); + select.value = root + lists[2]; + context.window.board.moveCardToTop = async () => { throw new Error('Move failed'); }; + await assert.rejects(context.handleChangeCardListSelect(event), /Move failed/); + assert.equal(card.value, cardIn(1)); + assert.equal(select.value, root + lists[1]); + assert.equal(select.disabled, false); +} + +async function testArchiveLifecycle() { + const { context, card, reset } = fixture('C:/Board/', (p) => p.replace(/\//g, '\\')); + await reset(0); + let release; + const gate = new Promise((resolve) => { release = resolve; }); + let archives = 0; + let closes = 0; + context.window.board.archiveCard = async () => { archives += 1; await gate; }; + context.clearQueuedEditorSave = () => {}; + context.createCloseAllModalsRequest = () => ({ key: 'Escape' }); + context.closeAllModals = async (_event, options) => { + assert.equal(options.skipEditorArchiveWait, true, 'Archive cleanup must not await itself'); + closes += 1; + }; + const first = context.archiveActiveEditorCard(); + assert.equal(context.archiveActiveEditorCard(), first, 'Repeated archive requests share one operation'); + assert.equal(context.waitForEditorArchiveIfNeeded(), first); + release(); + assert.equal(await first, true); + assert.equal(archives, 1); + assert.equal(closes, 1); + assert.equal(card.value, ''); + assert.equal(context.waitForEditorArchiveIfNeeded(), null); + + await reset(0); + context.window.board.archiveCard = async () => { throw new Error('Archive locked'); }; + await assert.rejects(context.archiveActiveEditorCard(), /Archive locked/); + assert.equal(context.waitForEditorArchiveIfNeeded(), null, 'Failure releases the modal transition guard'); + assert.notEqual(card.value, '', 'Failure keeps the editor card available'); + context.window.board.archiveCard = async () => {}; + assert.equal(await context.archiveActiveEditorCard(), true, 'Retry succeeds after failure'); +} + +async function main() { + await testArchiveLifecycle(); + for (const [root, nativePath] of [ + ['/tmp/Board with spaces/', (p) => p], + ['C:/Users/Test/Board with spaces/', (p) => p.replace(/\//g, '\\')], + ['C:/Users/Test/Board with spaces/', (p) => p.replace('/000-example', '\\000-example')], + ['//server/share/Board with spaces/', (p) => p.replace(/\//g, '\\')], + ]) await testMoves(root, nativePath); + + const context = vm.createContext({ console, window: {} }); + vm.runInContext(source, context); + for (const [input, expected] of [ + ['C:\\note.md', 'C:/'], + ['C:/note.md', 'C:/'], + ['C:\\Users\\Test\\note.md', 'C:/Users/Test'], + ['\\\\server\\share\\notes\\note.md', '//server/share/notes'], + ['\\\\server\\share\\note.md', '//server/share'], + ['//server/share/notes/note.md', '//server/share/notes'], + ['/notes/note.md', '/notes'], + ['/note.md', '/'], + ['notes/note.md', 'notes'], + ['note.md', ''], + ['', ''], + ]) { + assert.equal(context.getLinkedObjectDefaultPickerPath({ path: input }), expected, input); + } + console.log('Editor path regressions passed (POSIX, Windows, mixed separators, UNC, picker roots).'); +} + +main().catch((error) => { console.error(error); process.exitCode = 1; }); diff --git a/scripts/test-list-actions.js b/scripts/test-list-actions.js index 8a5bc12..f26332f 100644 --- a/scripts/test-list-actions.js +++ b/scripts/test-list-actions.js @@ -31,14 +31,15 @@ async function fixture(action) { reorderLists: (paths) => reorderListDirectories(root, paths), moveList: () => { throw new Error('Renderer must never stage list renames'); }, } }, - console: { error() {} }, rand5: async () => 'abcde', sanitizeFileName: async (text) => text, + console: { error() {} }, rand5: async () => 'abcde', closeAllModals: async () => { renders++; }, createCloseAllModalsRequest: () => ({}), renderBoard: async () => { renders++; }, announceSignboardStatus: (text) => announcements.push(text), }); - for (const file of ['app/cards/processAddNewList.js', 'app/lists/listActionsPopover.js']) { + for (const file of ['app/utilities/santizeFileName.js', 'app/cards/processAddNewList.js', 'app/lists/listActionsPopover.js']) { vm.runInContext(await fs.readFile(path.join(__dirname, '..', file), 'utf8'), context); } + context.rand5 = async () => 'abcde'; context.closeListActionsPopover = () => {}; const invoke = (operation) => operation === 'add' ? context.processAddNewList('Today', { afterListPath: path.join(root, names[0]) }) @@ -56,6 +57,18 @@ async function assertOriginalCards(root) { } async function run() { + for (const [input, expected] of [ + ['Release 1.7: QA', 'Release 1.7 QA'], + ['Phase.2/3', 'Phase.23'], + ['Notes.2?*<>|', 'Notes.2'], + ['Café.2: revisión', 'Café.2 revisión'], + ]) { + await fixture(async ({ context, lists, alerts }) => { + await context.processAddNewList(input); + assert.deepEqual(await lists(), [...names, `004-${expected}-abcde`]); + assert.equal(alerts.length, 0); + }); + } for (const operation of ['add', 'left', 'right']) { await fixture(async ({ root, lists, invoke, alerts, announcements }) => { await invoke(operation); diff --git a/scripts/test-maintenance.js b/scripts/test-maintenance.js index ed08642..cbb3911 100644 --- a/scripts/test-maintenance.js +++ b/scripts/test-maintenance.js @@ -105,6 +105,26 @@ async function run() { await renameManagedDirectory(renameBoard, renameBoard, movedBoard); assert.equal((await cards.readCard(path.join(movedBoard, renamedList, one.fileName))).frontmatter.signboard_board, 'Renamed board'); + // Case-insensitive filesystems resolve the requested spelling to the source + // entry. That is a rename, not a collision with an unrelated directory. + const caseBoard = path.join(temp, 'Case Board'); + const caseList = '000-Todo-stock'; + const upperList = '000-TODO-stock'; + await fs.mkdir(path.join(caseBoard, caseList), { recursive: true }); + const caseCard = await cli.createCard(caseBoard, { listRef: caseList, title: 'Keep case rename', body: 'Preserve notes.' }); + await labels.writeBoardSettings(caseBoard, { workflow: { completedListNames: [caseList] } }); + await cli.renameList(caseBoard, caseList, 'TODO'); + assert((await fs.readdir(caseBoard)).includes(upperList)); + assert(!(await fs.readdir(caseBoard)).includes(caseList)); + assert.equal((await cards.readCard(path.join(caseBoard, upperList, caseCard.fileName))).body, 'Preserve notes.'); + assert.deepEqual((await labels.readBoardSettings(caseBoard)).workflow.completedListNames, [upperList]); + const renamedCaseBoard = path.join(temp, 'CASE BOARD'); + await renameManagedDirectory(caseBoard, caseBoard, renamedCaseBoard); + assert((await fs.readdir(temp)).includes('CASE BOARD')); + assert.equal((await cards.readCard(path.join(renamedCaseBoard, upperList, caseCard.fileName))).frontmatter.signboard_board, 'CASE BOARD'); + await fs.mkdir(path.join(renamedCaseBoard, '001-Other-stock')); + await assert.rejects(renameManagedDirectory(renamedCaseBoard, path.join(renamedCaseBoard, upperList), path.join(renamedCaseBoard, '001-Other-stock')), /Destination already exists/); + const outside = path.join(temp, 'Outside'); await fs.mkdir(outside); await fs.writeFile(path.join(outside, 'outside.md'), '---\ntitle: Outside\n---\n'); diff --git a/scripts/test-mcp-server.js b/scripts/test-mcp-server.js index 2468ff6..0167f1b 100644 --- a/scripts/test-mcp-server.js +++ b/scripts/test-mcp-server.js @@ -21,7 +21,7 @@ function assertHeadlessMcpLaunchConfig() { if (!server || server.env.ELECTRON_RUN_AS_NODE !== '1') { throw new Error(`MCP config did not enable Electron Node mode: ${JSON.stringify(config)}`); } - if (server.args[0] !== '/Applications/Signboard.app/Contents/Resources/app.asar/bin/signboard-mcp.js') { + if (server.args[0] !== path.resolve('/Applications/Signboard.app/Contents/Resources/app.asar', 'bin/signboard-mcp.js')) { throw new Error(`MCP config did not target the headless entrypoint: ${JSON.stringify(config)}`); } if (server.args.includes('--mcp-server')) { diff --git a/static/styles.css b/static/styles.css index 4abf510..509156f 100644 --- a/static/styles.css +++ b/static/styles.css @@ -1017,6 +1017,8 @@ body[data-workspace-transition="exit-right"] main#board { } .planner-filter-popover { + overflow-y: auto; + overscroll-behavior: contain; top: calc(100% + 8px); right: 0; min-width: 250px; diff --git a/tests/playwright/signboard-smoke.spec.js b/tests/playwright/signboard-smoke.spec.js index c0e1f8c..fe16a1f 100644 --- a/tests/playwright/signboard-smoke.spec.js +++ b/tests/playwright/signboard-smoke.spec.js @@ -241,6 +241,9 @@ async function seedOpenBoardState(page, boardRoots, activeBoardRoot) { const normalizedBoardRoots = boardRoots.map(normalizeBoardRoot); const normalizedActiveBoardRoot = normalizeBoardRoot(activeBoardRoot || boardRoots[0]); + // Use the same roomy fixture viewport on every hosted desktop. Compact + // layout tests explicitly resize afterward; runner monitor size is incidental. + await page.setViewportSize({ width: 1280, height: 860 }); await page.waitForLoadState('domcontentloaded'); await page.waitForSelector('#board'); await page.evaluate(({ openBoards, activeBoard }) => { @@ -1954,7 +1957,23 @@ test('drops cards into the lower area of an empty list column', async ({ page, b emptyListCards.map((fileName) => fs.rm(path.join(emptyListPath, fileName), { force: true })) ); await seedBoardState(page, boardRoot); - await page.waitForTimeout(650); + // Deleting the fixture card and reopening the board queue filesystem events. + // Observe a quiet watch cycle before measuring renders caused by the drop; + // a fixed startup delay can count a late setup refresh as a drop regression. + let quietSince = 0; + let lastToken; + await expect.poll(async () => { + const state = await page.evaluate(async () => ({ + token: Number(await window.board.getBoardWatchToken()), + acknowledged: externalBoardWatchToken, + busy: externalBoardSyncInFlight || externalBoardRenderInFlight + || externalBoardRefreshPending || Boolean(externalBoardRenderTimeoutId), + })); + const settled = !state.busy && state.token === state.acknowledged; + if (!settled || state.token !== lastToken) quietSince = Date.now(); + lastToken = state.token; + return settled && Date.now() - quietSince >= 750; + }, { timeout: 10_000, intervals: [100] }).toBe(true); await page.evaluate(() => { const originalRenderBoard = window.renderBoard; window.__postDropRenderCount = 0; @@ -2247,6 +2266,13 @@ test('bulk manages selected table cards', async ({ page, boardRoot }) => { await expectBulkDateRowControlsDoNotOverlap(datesMenu.locator('.board-table-bulk-date-row').nth(1)); const dueRow = datesMenu.locator('.board-table-bulk-date-row').filter({ hasText: 'Due' }); await dueRow.locator('input').fill('2026-04-20'); + await expect(dueRow.locator('input')).toHaveValue('2026-04-20'); + // A queued filesystem refresh must not replace the draft date input. + await page.evaluate(async () => { + externalBoardRefreshPending = true; + await runExternalBoardRefresh(); + }); + await expect(dueRow.locator('input')).toHaveValue('2026-04-20'); await dueRow.getByRole('button', { name: 'Set' }).click(); await expect.poll(async () => { const planCard = await cardFrontmatter.readCard(planPath); @@ -2400,6 +2426,28 @@ test('adds a new list to the right of the invoking list from the list actions po }).toMatch(/^001-Review-[A-Za-z0-9]{5}$/); }); +test('creates lists with punctuation after a period using portable folder names', async ({ page, boardRoot }) => { + await page.locator('.list-actions-button').first().click(); + await page.locator('#listActionsPopover').getByRole('button', { name: 'Add new list' }).click(); + await page.locator('#userInputListName').fill('Release 1.7: QA'); + await page.locator('#btnAddList').click(); + await expect(page.locator('.list')).toHaveCount(4); + await expect(page.locator('.list .list-header span[contenteditable="true"]').nth(1)).toHaveText('Release 1.7 QA'); + expect((await fs.readdir(boardRoot)).some((name) => /^001-Release 1\.7 QA-[A-Za-z0-9]{5}$/.test(name))).toBe(true); +}); + +test('renames a list when only letter case changes', async ({ page, boardRoot }) => { + const title = page.locator('.list').first().getByRole('textbox', { name: 'List name' }); + await title.fill('TO-DO'); + await title.press('Enter'); + await expect.poll(() => fs.readdir(boardRoot)).toContain('000-TO-DO-stock'); + expect(await fs.readdir(boardRoot)).not.toContain('000-To-do-stock'); + const card = await cardFrontmatter.readCard(path.join(boardRoot, '000-TO-DO-stock', '000-plan-release-stock.md')); + expect(card.body).toBe('Outline the next release notes draft.'); + expect(card.frontmatter.signboard_list).toBe('TO-DO'); + await expect(page.locator('.list').first().getByRole('textbox', { name: 'List name' })).toHaveText('TO-DO'); +}); + test('moves lists left and right through the list actions popover', async ({ page, boardRoot }) => { const titles = page.locator('.list .list-header span[contenteditable="true"]'); await page.locator('.list-actions-button').nth(1).click(); @@ -2842,6 +2890,29 @@ test('refreshes current Planner dates after a local day rollover without moving expect(pinnedResult.renderedWeek).toBe(pinnedResult.expectedPinnedWeek); }); +test('keeps Planner filters reachable in a compact window with many labels', async ({ page }) => { + await page.setViewportSize({ width: 960, height: 640 }); + await page.evaluate(async () => { + await window.board.updateBoardSettings(window.boardRoot, { + labels: Array.from({ length: 24 }, (_, index) => ({ id: `qa-${index}`, name: `QA Label ${index}`, colorLight: '#fb923c', colorDark: '#f97316' })), + }); + await renderBoard(); + }); + await page.keyboard.press(getCurrentBoardPlannerShortcut('2')); + await page.locator('#plannerFilterButton').click(); + const popover = page.locator('#plannerFilterPopover'); + await expect(popover).toBeVisible(); + const bounds = await popover.boundingBox(); + expect(bounds.y).toBeGreaterThanOrEqual(0); + expect(bounds.y + bounds.height).toBeLessThanOrEqual(640); + await page.setViewportSize({ width: 960, height: 520 }); + await expect.poll(async () => { const rect = await popover.boundingBox(); return rect.y + rect.height; }).toBeLessThanOrEqual(520); + await popover.getByText('QA Label 23', { exact: true }).click(); + await expect(popover.getByRole('checkbox', { name: 'QA Label 23' })).toBeChecked(); + await popover.getByRole('button', { name: 'Clear filters' }).click(); + await expect(popover.getByRole('checkbox', { name: 'QA Label 23' })).not.toBeChecked(); +}); + test('opens Planner across currently open boards', async ({ electronApp, boardRoot }) => { const { page, boardRoots } = await prepareOpenBoardsPage(electronApp, boardRoot, ['Roadmap Board']); const todayIso = formatLocalIsoDate(); @@ -3257,6 +3328,36 @@ test('moves the active card to the top of the selected list from the editor drop await expect(page.locator('.list').nth(1).locator('.card').first()).toContainText('Plan release notes'); }); +test('keeps editor list controls and saved notes correct after repeated moves', async ({ page, boardRoot }) => { + await openCardInEditor(page, 1, 0); + const select = page.locator('#cardEditorListSelect'); + const cardPath = page.locator('#cardEditorCardPath'); + const doing = path.join(boardRoot, '001-Doing-stock', '000-polish-copy-stock.md'); + const done = path.join(boardRoot, '002-Done-stock', '000-polish-copy-stock.md'); + const before = await cardFrontmatter.readCard(doing); + + await expect(select).toHaveValue(`${normalizeBoardRoot(boardRoot)}001-Doing-stock`); + await select.selectOption({ label: 'Done' }); + await expect(cardPath).toHaveValue(done); + await expect(select).toHaveValue(`${normalizeBoardRoot(boardRoot)}002-Done-stock`); + await expect(page.locator('#cardEditorMoveListLink')).toHaveAttribute('aria-label', 'Move to previous list'); + + await page.locator('#cardEditorMoveListLink').click(); + await expect(cardPath).toHaveValue(doing); + await expect(select).toHaveValue(`${normalizeBoardRoot(boardRoot)}001-Doing-stock`); + await page.keyboard.press(getShortcut('Shift+]')); + await expect(cardPath).toHaveValue(done); + + const body = `${before.body}\nSaved after moving twice on native paths.`; + await setEditorBody(page, body); + await page.locator('#cardEditorClose').click(); + await expect.poll(async () => (await cardFrontmatter.readCard(done)).body.trim()).toBe(body.trim()); + const after = await cardFrontmatter.readCard(done); + expect(after.frontmatter.title).toBe(before.frontmatter.title); + expect(after.frontmatter.labels).toEqual(before.frontmatter.labels); + await expect(page.locator('.list').nth(2).locator('.card').first()).toContainText('Polish homepage copy'); +}); + test('rejects top-of-list card moves outside the active board', async ({ page, boardRoot }) => { const outsideBoardPath = path.dirname(boardRoot); @@ -3322,6 +3423,49 @@ test('opens the archive browser from the keyboard shortcut', async ({ page }) => await expect(page.locator('#archiveBrowserSearchInput')).toBeFocused(); }); +test('keeps Archive open when requested before the card archive finishes', async ({ page, electronApp }) => { + await openFirstCardInEditor(page); + await page.evaluate(() => { + const original = archiveActiveEditorCard; + archiveActiveEditorCard = async () => { + try { return await original(); } + finally { window.__archiveActionFinished = true; } + }; + }); + await electronApp.evaluate(() => { + const promises = process.getBuiltinModule('fs').promises; + const original = promises.rename; + globalThis.__archiveOriginalRename = original; + promises.rename = async (from, to) => { + const result = await original(from, to); + if (!globalThis.__releaseArchiveRename && String(to).includes('XXX-Archive') && String(to).endsWith('.md')) { + await new Promise((resolve) => { globalThis.__releaseArchiveRename = resolve; }); + } + return result; + }; + }); + try { + await page.keyboard.press(getArchiveCardShortcut()); + await expect.poll(() => electronApp.evaluate(() => typeof globalThis.__releaseArchiveRename)).toBe('function'); + await page.keyboard.press(getShortcut('Shift+A')); + // Let the shortcut handler reach its first modal-close await before IPC completes. + await page.evaluate(() => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)))); + await electronApp.evaluate(() => globalThis.__releaseArchiveRename()); + await expect.poll(() => page.evaluate(() => window.__archiveActionFinished)).toBe(true); + await expect(page.locator('#modalEditCard')).toBeHidden(); + await expect(page.locator('#modalArchiveBrowser')).toBeVisible(); + await page.locator('#archiveBrowserSearchInput').fill('release'); + await expect(page.locator('.archive-browser-row').filter({ hasText: 'Plan release notes' })).toBeVisible(); + } finally { + await electronApp.evaluate(() => { + globalThis.__releaseArchiveRename?.(); + process.getBuiltinModule('fs').promises.rename = globalThis.__archiveOriginalRename; + delete globalThis.__archiveOriginalRename; + delete globalThis.__releaseArchiveRename; + }); + } +}); + test('navigates archive browser results from search with the keyboard', async ({ page, boardRoot }) => { await openFirstCardInEditor(page); await page.keyboard.press(getArchiveCardShortcut()); @@ -4591,7 +4735,7 @@ test('Planner card editing preserves the Kanban board its scheme and filters', a const dueColor = await planner.evaluate(el => getComputedStyle(el).getPropertyValue('--due-date-today-color')); await entry.click(); await expect(page.locator('#modalEditCard')).toBeVisible(); - await expect(page.locator('#cardEditorListSelect')).toHaveValue(path.join(cardRoot, '001-Doing-stock')); + await expect(page.locator('#cardEditorListSelect')).toHaveValue(`${cardRoot}001-Doing-stock`); expect(await page.evaluate(() => getStoredActiveBoard())).toBe(sourceRoot); expect(await planner.evaluate(el => getComputedStyle(el).backgroundColor)).toBe(plannerBackground); await expect.poll(() => frame.evaluate(el => getComputedStyle(el).backgroundColor)).toBe(frameBackground);