Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/maintenance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
npm run test:editor-paths
npm run test:board-refresh
npm run test:board-card-metadata
npm run test:speed-reliability
- name: Prepare isolated Electron desktop
run: |
sudo apt-get -o Acquire::Retries=1 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30 update
Expand Down Expand Up @@ -102,7 +103,7 @@ jobs:
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
for suite in maintenance speed-reliability 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"
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,9 @@ App settings save responses reconcile against the submitted snapshot: preserve n
## Card move metadata — 1.7.8

`lib/archive.js` records cross-list move activity and normalizes destination Signboard properties in one atomic card write. Desktop drag/drop and move-to-top must not follow it with a second metadata write. Same-list drag reorders leave card contents unchanged. Preserve body/custom fields and the atomic-failure regression in `test:archive`; filtered-drag Electron tests assert both `status` and `signboard_list` before opening the editor.

## Speed and reliability — 1.7.9

- Preload formats short due dates locally with a cache instead of per-card IPC, `waitForNativeMenuTrackingToSettle()` applies the 250ms AppKit settle delay only on macOS, tooltips resolve lazily without a global `document.body` `MutationObserver`, `renderBoard()` reuses `readBoardSnapshot`'s `boardSettings` and skips hidden Settings rebuilds, Archive Browser filters/sorts once per render, and startup skips already-completed app-settings migration while batching due-notification reads.
- Storage and main-process helpers exclude hidden dot-entries (`.git`, `.obsidian`, `._*.md`) from snapshots and ordering, protect `board-settings.md`/`app-settings.json`/card frontmatter against UTF-8 BOMs and parse-error wipes, harden `lib/fileTransaction.js` stale `.reap` recovery and wire locks into settings/frontmatter/CLI/MCP mutations, retry transient Windows `EPERM`/`EACCES`/`EBUSY` renames/unlinks, stop the board watcher before renaming `activeBoardRoot` on Windows, run Arch `pkexec pacman -U` asynchronously, avoid per-card-save Obsidian Base sync and unchanged-card rewrites, and cache/coalesce External Published Calendar feeds with UTF-8 byte-safe ICS folding.
- MCP fixes split-chunk `Content-Length` framing and `stdin` EOF response draining, handles `stdout`/`stderr` `EPIPE`, catches `EACCES`/`EPERM` junction errors in board discovery, pre-resolves canonical `allowedRoots` per call and scopes `assertAllowedTree`, refreshes desktop trusted/open state on mtime change, and preserves Windows paths in card bodies. CLI adds filename/card-ID-first `resolveCard`, lazy-loads heavy subcommands/importers, fixes boolean flag parsing and `--from-card` empty `titlePrefix`, and emits a direct `exec` wrapper on Linux. Keep `npm run test:speed-reliability` aligned.
6 changes: 6 additions & 0 deletions CODEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,9 @@ App settings save responses reconcile against the submitted snapshot: preserve n
## Card move metadata — 1.7.8

`lib/archive.js` records cross-list move activity and normalizes destination Signboard properties in one atomic card write. Desktop drag/drop and move-to-top must not follow it with a second metadata write. Same-list drag reorders leave card contents unchanged. Preserve body/custom fields and the atomic-failure regression in `test:archive`; filtered-drag Electron tests assert both `status` and `signboard_list` before opening the editor.

## Speed and reliability — 1.7.9

- Preload formats short due dates locally with a cache instead of per-card IPC, `waitForNativeMenuTrackingToSettle()` applies the 250ms AppKit settle delay only on macOS, tooltips resolve lazily without a global `document.body` `MutationObserver`, `renderBoard()` reuses `readBoardSnapshot`'s `boardSettings` and skips hidden Settings rebuilds, Archive Browser filters/sorts once per render, and startup skips already-completed app-settings migration while batching due-notification reads.
- Storage and main-process helpers exclude hidden dot-entries (`.git`, `.obsidian`, `._*.md`) from snapshots and ordering, protect `board-settings.md`/`app-settings.json`/card frontmatter against UTF-8 BOMs and parse-error wipes, harden `lib/fileTransaction.js` stale `.reap` recovery and wire locks into settings/frontmatter/CLI/MCP mutations, retry transient Windows `EPERM`/`EACCES`/`EBUSY` renames/unlinks, stop the board watcher before renaming `activeBoardRoot` on Windows, run Arch `pkexec pacman -U` asynchronously, avoid per-card-save Obsidian Base sync and unchanged-card rewrites, and cache/coalesce External Published Calendar feeds with UTF-8 byte-safe ICS folding.
- MCP fixes split-chunk `Content-Length` framing and `stdin` EOF response draining, handles `stdout`/`stderr` `EPIPE`, catches `EACCES`/`EPERM` junction errors in board discovery, pre-resolves canonical `allowedRoots` per call and scopes `assertAllowedTree`, refreshes desktop trusted/open state on mtime change, and preserves Windows paths in card bodies. CLI adds filename/card-ID-first `resolveCard`, lazy-loads heavy subcommands/importers, fixes boolean flag parsing and `--from-card` empty `titlePrefix`, and emits a direct `exec` wrapper on Linux. Keep `npm run test:speed-reliability` aligned.
16 changes: 9 additions & 7 deletions app/appSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,16 @@ async function loadAppSettings() {
}

async function migrateAppSettingsFromOpenBoards() {
const loadedSettings = await loadAppSettings();
if (loadedSettings && loadedSettings.migration && loadedSettings.migration.boardSettingsMigrated) {
return;
}

if (
!window.electronAPI ||
typeof window.electronAPI.migrateAppSettingsFromBoard !== 'function' ||
typeof getStoredOpenBoards !== 'function'
) {
await loadAppSettings();
return;
}

Expand All @@ -375,25 +379,23 @@ async function migrateAppSettingsFromOpenBoards() {
let migratedSettings = null;
for (const boardRoot of openBoards) {
const result = await window.electronAPI.migrateAppSettingsFromBoard(boardRoot);
if (!migratedSettings && result && result.settings) {
if (result && result.settings) {
migratedSettings = result.settings;
if (result.settings.migration && result.settings.migration.boardSettingsMigrated) {
break;
}
}
}

if (migratedSettings) {
applyAppSettings(migratedSettings);
renderAppSettingsControls();
if (getAppAiSettings().enabled) {
refreshAppAiOllamaModels();
}
return;
}
} catch (error) {
console.warn('Unable to migrate app settings from board settings.', error);
}
}

await loadAppSettings();
}

function renderAppSettingsControls() {
Expand Down
59 changes: 36 additions & 23 deletions app/board/archiveBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,10 @@ async function clearArchiveBrowserSearchFromKeyboard(searchInput) {
state.searchQuery = '';
resetArchiveBrowserPagination(state.activeTab);
state.selectedEntryPath = '';
renderArchiveBrowserModal();

const selectedPath = syncArchiveBrowserSelection(getFilteredArchiveEntries());
renderArchiveBrowserModal();
const filteredEntries = getFilteredArchiveEntries();
const selectedPath = syncArchiveBrowserSelection(filteredEntries);
renderArchiveBrowserModal(filteredEntries);
if (selectedPath) {
await loadArchiveBrowserDetail(selectedPath);
}
Expand Down Expand Up @@ -561,7 +561,7 @@ function handleArchiveBrowserResultKeydown(event) {
}
}

function renderArchiveBrowserResults() {
function renderArchiveBrowserResults(precomputedFilteredEntries) {
const state = getArchiveBrowserState();
const resultsEl = document.getElementById('archiveBrowserResults');
const resultCountEl = document.getElementById('archiveBrowserResultCount');
Expand All @@ -570,7 +570,9 @@ function renderArchiveBrowserResults() {
}

const totalEntries = getArchiveEntriesForActiveTab();
const filteredEntries = getFilteredArchiveEntries();
const filteredEntries = Array.isArray(precomputedFilteredEntries)
? precomputedFilteredEntries
: getFilteredArchiveEntries();
syncArchiveBrowserSelection(filteredEntries);
const visibleCount = Math.max(ARCHIVE_BROWSER_BATCH_SIZE, state.visibleCountByTab[state.activeTab] || ARCHIVE_BROWSER_BATCH_SIZE);
const entriesToRender = filteredEntries.slice(0, visibleCount);
Expand Down Expand Up @@ -686,14 +688,16 @@ function renderArchiveBrowserResults() {
resultCountEl.textContent = getArchiveBrowserResultCountLabel(filteredEntries, totalEntries);
}

function renderArchiveBrowserDetail() {
function renderArchiveBrowserDetail(precomputedFilteredEntries) {
const state = getArchiveBrowserState();
const detailEl = document.getElementById('archiveBrowserDetail');
if (!detailEl) {
return;
}

const filteredEntries = getFilteredArchiveEntries();
const filteredEntries = Array.isArray(precomputedFilteredEntries)
? precomputedFilteredEntries
: getFilteredArchiveEntries();
const selectedEntry = getSelectedArchiveEntry(filteredEntries);
detailEl.innerHTML = '';

Expand Down Expand Up @@ -844,7 +848,7 @@ function renderArchiveBrowserDetail() {
}
}

function renderArchiveRestoreDialog() {
function renderArchiveRestoreDialog(precomputedFilteredEntries) {
const state = getArchiveBrowserState();
const dialogEl = document.getElementById('archiveRestoreDialog');
const titleEl = document.getElementById('archiveRestoreTitle');
Expand All @@ -857,7 +861,9 @@ function renderArchiveRestoreDialog() {
return;
}

const filteredEntries = getFilteredArchiveEntries();
const filteredEntries = Array.isArray(precomputedFilteredEntries)
? precomputedFilteredEntries
: getFilteredArchiveEntries();
const selectedEntry = getSelectedArchiveEntry(filteredEntries);
const restoreEntry = selectedEntry && selectedEntry.entryPath === state.restore.entryPath
? selectedEntry
Expand Down Expand Up @@ -935,7 +941,7 @@ function renderArchiveRestoreDialog() {
confirmButton.textContent = state.restore.isSaving ? 'Restoring...' : 'Restore card';
}

function renderArchiveBrowserModal() {
function renderArchiveBrowserModal(precomputedFilteredEntries) {
const state = getArchiveBrowserState();
const modal = getArchiveBrowserModal();
const searchInput = document.getElementById('archiveBrowserSearchInput');
Expand All @@ -945,16 +951,20 @@ function renderArchiveBrowserModal() {
return;
}

const filteredEntries = Array.isArray(precomputedFilteredEntries)
? precomputedFilteredEntries
: getFilteredArchiveEntries();

cardsTab.classList.toggle('is-active', state.activeTab === ARCHIVE_BROWSER_TAB_IDS.CARDS);
listsTab.classList.toggle('is-active', state.activeTab === ARCHIVE_BROWSER_TAB_IDS.LISTS);
cardsTab.setAttribute('aria-selected', state.activeTab === ARCHIVE_BROWSER_TAB_IDS.CARDS ? 'true' : 'false');
listsTab.setAttribute('aria-selected', state.activeTab === ARCHIVE_BROWSER_TAB_IDS.LISTS ? 'true' : 'false');
searchInput.value = state.searchQuery;
searchInput.placeholder = getArchiveBrowserSearchPlaceholder();
renderArchiveBrowserSortOptions();
renderArchiveBrowserResults();
renderArchiveBrowserDetail();
renderArchiveRestoreDialog();
renderArchiveBrowserResults(filteredEntries);
renderArchiveBrowserDetail(filteredEntries);
renderArchiveRestoreDialog(filteredEntries);
}

async function loadArchiveBrowserDetail(entryPath) {
Expand Down Expand Up @@ -1037,11 +1047,10 @@ async function refreshArchiveBrowserData() {
};
state.selectedEntryPath = previousSelectedEntryPath;
state.isLoading = false;
renderArchiveBrowserModal();

const filteredEntries = getFilteredArchiveEntries();
const selectedPath = syncArchiveBrowserSelection(filteredEntries);
renderArchiveBrowserModal();
renderArchiveBrowserModal(filteredEntries);
if (selectedPath) {
await loadArchiveBrowserDetail(selectedPath);
}
Expand Down Expand Up @@ -1134,12 +1143,19 @@ function openArchiveRestoreDialog(entry) {
return Promise.resolve();
}

return window.board.listLists(window.boardRoot).then((listNames) => {
const requestId = state.requestId;
const boardRoot = window.boardRoot;

return window.board.listLists(boardRoot).then((listNames) => {
if (requestId !== state.requestId || !isArchiveBrowserModalOpen() || window.boardRoot !== boardRoot) {
return;
}

const names = Array.isArray(listNames) ? listNames : [];
const availableLists = names.map((directoryName) => ({
directoryName,
displayName: getArchiveDisplayNameForList(directoryName),
path: `${window.boardRoot}${directoryName}`,
path: `${boardRoot}${directoryName}`,
})).sort((left, right) => left.displayName.localeCompare(right.displayName, undefined, {
numeric: true,
sensitivity: 'base',
Expand Down Expand Up @@ -1332,11 +1348,10 @@ function setArchiveBrowserActiveTab(tabId) {
: ARCHIVE_BROWSER_TAB_IDS.CARDS;
resetArchiveBrowserPagination(state.activeTab);
state.selectedEntryPath = '';
renderArchiveBrowserModal();

const filteredEntries = getFilteredArchiveEntries();
const selectedPath = syncArchiveBrowserSelection(filteredEntries);
renderArchiveBrowserModal();
renderArchiveBrowserModal(filteredEntries);
if (selectedPath) {
loadArchiveBrowserDetail(selectedPath).catch((error) => {
console.error('Unable to load archive detail.', error);
Expand Down Expand Up @@ -1414,11 +1429,10 @@ function initializeArchiveBrowserControls() {
state.searchQuery = String(event.currentTarget.value || '');
resetArchiveBrowserPagination(state.activeTab);
state.selectedEntryPath = '';
renderArchiveBrowserModal();

const filteredEntries = getFilteredArchiveEntries();
const selectedPath = syncArchiveBrowserSelection(filteredEntries);
renderArchiveBrowserModal();
renderArchiveBrowserModal(filteredEntries);
if (selectedPath) {
await loadArchiveBrowserDetail(selectedPath);
}
Expand All @@ -1443,11 +1457,10 @@ function initializeArchiveBrowserControls() {
state.sortKeyByTab[state.activeTab] = nextSortKey;
resetArchiveBrowserPagination(state.activeTab);
state.selectedEntryPath = '';
renderArchiveBrowserModal();

const filteredEntries = getFilteredArchiveEntries();
const selectedPath = syncArchiveBrowserSelection(filteredEntries);
renderArchiveBrowserModal();
renderArchiveBrowserModal(filteredEntries);
if (selectedPath) {
await loadArchiveBrowserDetail(selectedPath);
}
Expand Down
69 changes: 53 additions & 16 deletions app/board/boardLabels.js
Original file line number Diff line number Diff line change
Expand Up @@ -4300,7 +4300,7 @@ async function runBoardImport(importer) {
}

const boardInfo = getBoardRootInfo();
const defaultPath = boardInfo ? boardInfo.parentRoot.replace(/\/+$/, '') : undefined;
const defaultPath = boardInfo ? formatBoardPickerParentPath(boardInfo.parentRoot) : undefined;

await flushBoardSettingsSave();
state.importInProgress = importer;
Expand Down Expand Up @@ -4530,8 +4530,31 @@ function resetBoardLabelFilter() {
state.activeDateFilter = BOARD_DATE_FILTER_NONE;
}

async function ensureBoardLabelsLoaded() {
if (!window.boardRoot) {
function formatBoardPickerParentPath(parentRoot) {
const normalized = String(parentRoot || '').trim();
if (!normalized) {
return undefined;
}
if (/^[A-Za-z]:\/+$/.test(normalized)) {
return `${normalized.slice(0, 2)}/`;
}
if (/^\/+$/.test(normalized)) {
return '/';
}
return normalized.replace(/\/+$/, '');
}

let boardLabelsLoadRequestId = 0;

async function ensureBoardLabelsLoaded(options = {}) {
boardLabelsLoadRequestId += 1;
const requestId = boardLabelsLoadRequestId;
const requestedBoardRoot = typeof normalizeBoardPath === 'function'
? normalizeBoardPath(options && options.boardRoot ? options.boardRoot : window.boardRoot)
: String((options && options.boardRoot) || window.boardRoot || '');
const settingsModalOpen = typeof isBoardSettingsModalOpen === 'function' && isBoardSettingsModalOpen();

if (!requestedBoardRoot) {
const state = getBoardLabelState();
state.importSummaryBoardRoot = '';
resetBoardLabelFilter();
Expand All @@ -4541,16 +4564,28 @@ async function ensureBoardLabelsLoaded() {
applyColorSchemeById('light', { renderControls: false });
renderBoardLabelFilterButton();
renderBoardLabelFilterPopover();
renderBoardThemeSettingsControls();
renderBoardGeneralSettingsControls();
renderBoardWorkflowSettingsControls();
renderBoardExternalPublishedCalendarSettingsControls();
renderAppSettingsControls();
renderBoardImportControls();
if (settingsModalOpen) {
renderBoardThemeSettingsControls();
renderBoardGeneralSettingsControls();
renderBoardWorkflowSettingsControls();
renderBoardExternalPublishedCalendarSettingsControls();
renderAppSettingsControls();
renderBoardImportControls();
}
return;
}

const settings = options && options.preloadedSettings && typeof options.preloadedSettings === 'object'
? options.preloadedSettings
: await window.board.readBoardSettings(requestedBoardRoot);

const currentBoardRoot = typeof normalizeBoardPath === 'function'
? normalizeBoardPath(window.boardRoot)
: String(window.boardRoot || '');
if (requestId !== boardLabelsLoadRequestId || currentBoardRoot !== requestedBoardRoot) {
return;
}

const settings = await window.board.readBoardSettings(window.boardRoot);
setBoardLabels(settings.labels || []);
setBoardWorkflowSettings(settings.workflow || {});
setBoardExternalPublishedCalendarSettings(settings.externalPublishedCalendar || {});
Expand All @@ -4562,12 +4597,14 @@ async function ensureBoardLabelsLoaded() {
}
renderBoardLabelFilterButton();
renderBoardLabelFilterPopover();
renderBoardThemeSettingsControls();
renderBoardGeneralSettingsControls();
renderBoardWorkflowSettingsControls();
renderBoardExternalPublishedCalendarSettingsControls();
renderAppSettingsControls();
renderBoardImportControls();
if (settingsModalOpen) {
renderBoardThemeSettingsControls();
renderBoardGeneralSettingsControls();
renderBoardWorkflowSettingsControls();
renderBoardExternalPublishedCalendarSettingsControls();
renderAppSettingsControls();
renderBoardImportControls();
}
}

function closeAllLabelPopovers() {
Expand Down
2 changes: 1 addition & 1 deletion app/board/boardTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function normalizeBoardPath(dir) {
return '';
}

const normalizedDir = dir.replace(/\\/g, '/').trim();
const normalizedDir = dir.replace(/\\/g, '/').trim().replace(/^([a-z]):\//, (_, drive) => `${drive.toUpperCase()}:/`);
if (!normalizedDir) {
return '';
}
Expand Down
Loading