Skip to content

App updates, favorites polish, in-app name dialog, drag & drop - #4

Merged
SPhillips1337 merged 3 commits into
mainfrom
feat/updates-favorites-dialog-dnd
Nov 17, 2026
Merged

SPhillips1337 merged 3 commits into
mainfrom
feat/updates-favorites-dialog-dnd

Conversation

@SPhillips1337

Copy link
Copy Markdown
Contributor

What's in here

Two commits covering the verified-but-uncommitted work from the last two batches:

1. Consent-based app updates + favorites polish (046eacc)

  • Updates from GitHub releases: startup/manual checks, in-place install for NSIS builds, release-page notification for portable builds, settings controls, tag-driven Windows release workflow (27 tests).
  • Favorites: order-preserving rename, picker rename/remove controls, path action toggles Add/Remove (+2 tests).

2. In-app name dialog + Explorer-style drag & drop (df40d10)

  • Bug fix: Electron never implements window.prompt(), so New Folder, New File (type + name), Rename (F2) and favorite naming silently did nothing in the packaged app — in both panes. All five prompt sites now use a validated in-app dialog (inline errors, Enter/Esc, focus trap, autofocus + select); new folders land selected. Delete already used window.confirm (supported) and is unchanged.
  • Drag & drop inside and between panes, reusing the existing F5/F6 move/copy IPC (no new main-process file logic): drag = move, Ctrl = copy, Shift = force move, cross-drive defaults to copy. Drop targets: folder rows/tiles, pane background, the .. row, breadcrumb segments — in either pane. Whole-selection drag with an item-count chip, live drop-target highlight and a Move/Copy hint in the pane footer. Both panes refresh and each op logs to the transcript. Same-folder moves and drops into a folder's own subtree are no-ops; same-folder Ctrl-copy gets the existing "(n)" clash suffix.
  • New pure modules src/shared/text-dialog.ts and src/shared/drag-drop.ts follow the existing pane-* testable-module pattern (24 new tests).

Verification

  • npm run ci green on the final tree: typecheck + 188 tests (was 164) + build; git diff --check clean.
  • Commit 1's tree verified separately at its own test count (164).
  • Real Electron window (hidden) driving the built renderer against a temp filesystem: 14/14 UI checks — dialog with the right pane focused, prefilled, invalid-name inline error, folder created on disk + selected, Esc cancel, F2 rename on disk, cross-pane drag move, both panes refreshed, Ctrl+drag copy keeps the original, drop onto a folder row, same-folder no-op.

Notes

  • NSIS/portable installers not rebuilt in this pass; release workflow lands with this PR and runs on the next v* tag.
  • Drag-in from Windows Explorer is deliberately out of scope (needs webUtils.getPathForFile) — easy follow-up.
  • npm audit findings in the Vitest/electron-builder chains unchanged; no forced upgrades.
  • PROGRESS.md / ROADMAP.md updated (P1.7/P1.8 done; drag-drop moved out of Later/park).

SPhillips1337 and others added 2 commits November 16, 2026 17:43
- App updates from GitHub releases: startup/manual checks, NSIS in-place
  install, portable release-page notification, settings controls, and a
  tag-driven Windows release workflow (27 tests)
- Favorites: order-preserving rename, picker rename/remove controls, and a
  path action that toggles Add/Remove (+2 tests)

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
Electron never implements window.prompt, so New Folder, New File, Rename
(F2) and favorite naming silently did nothing in the packaged app. Replace
all five prompt sites with a validated in-app dialog (inline errors,
Enter/Esc, focus trap); new folders land selected.

Add drag & drop inside and between panes, reusing the F5/F6 move/copy IPC:
drag = move, Ctrl = copy, Shift = force move, cross-drive defaults to copy;
folder rows/tiles, pane background, ".." and breadcrumbs are drop targets;
whole-selection drag with an item-count chip; live target highlight and a
Move/Copy hint; both panes refresh and ops log to the transcript. Same-folder
moves and drops into a folder's own subtree are no-ops.

24 new tests (188 total); verified in a real Electron window: 14/14 UI checks.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This is a large, well-structured PR covering auto-updates, favorites rename, the in-app text dialog replacing window.prompt, and drag-and-drop. The architecture is clean — pure modules with testable logic separated from DOM/IPC, the update flow is consent-based, and the security posture (IPC origin checks, navigation blocking, safeReleaseUrl validation) is solid.

Three issues require attention before merge:

Must Fix

  1. src/main/update-service.ts — If the fallback lookUpRelease() call inside the install-mode catch block throws (e.g., a secondary network error), the exception escapes unhandled and the service is permanently stuck in 'checking' state. The user can never retry. Needs its own try/catch. (Comment posted on the relevant lines with a suggested fix.)

  2. .github/workflows/release.yml — The prerelease heuristic *-* matches any tag containing a hyphen, not just SemVer prerelease tags. A stable tag like v1.0-hotfix would be incorrectly published as a prerelease. The check should anchor to SemVer format (v1.2.3-…). (Comment posted with a suggested fix.)

  3. src/main/favorites-store.ts — renameFavorite uses .toLowerCase() on both sides when looking up the favorite by path, which is incorrect on POSIX (Linux/macOS) where paths are case-sensitive. This can cause false matches or miss the correct entry. The lookup should only be case-insensitive on Windows paths. (Comment posted.)


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread src/main/favorites-store.ts Outdated
const nextLabel = typeof label === 'string' ? label.trim() : '';
if (!nextLabel) throw new Error('Favorite name cannot be empty.');
const current = await listFavorites();
if (!current.some((favorite) => favorite.path.toLowerCase() === resolved.toLowerCase())) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: The case-insensitive path comparison using .toLowerCase() will incorrectly match distinct case-sensitive paths on POSIX systems (Linux/macOS). For example, /home/user/Docs and /home/user/docs are two different directories on Linux, but this check treats them as the same favorite, causing renameFavorite to find a false match (or miss the real one). Only Windows paths should be compared case-insensitively. This is inconsistent with the sameLocation utility in drag-drop.ts which applies lowercasing only for Windows paths.

Comment thread .github/workflows/release.yml Outdated
shopt -s nullglob
assets=(release-assets/*)
release_flags=()
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then release_flags+=(--prerelease); fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: The prerelease detection heuristic *-* matches any tag containing a hyphen, not just SemVer prerelease identifiers. This will incorrectly flag a stable tag like v1.0-hotfix or v2.0-windows as a prerelease. The pattern should check for a hyphen in the version part after the patch number only (e.g., v1.2.3-beta.1), not anywhere in the tag name.

Suggested change
if [[ "${GITHUB_REF_NAME}" == *-* ]]; then release_flags+=(--prerelease); fi
if [[ "${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+- ]]; then release_flags+=(--prerelease); fi

Comment on lines +104 to +110
} catch (error) {
// A release published without its update manifest (latest.yml), or one
// the installer cannot read, should still be announced: fall back to
// the release page, and offer the download link instead of an install.
const fallback = await this.lookUpRelease();
if (fallback.status === 'available') return this.set({ ...fallback, mode: 'notify' });
return this.set({ status: 'error', ...this.base(), message: shortError(error) });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: When lookUpRelease() itself throws (e.g., a secondary network error during the fallback), the exception propagates up and is caught by the outer catch (error) block at line 104. At that point, error is the original checkForUpdates exception, not the error from lookUpRelease — but the actual runtime failure was in lookUpRelease. The error message shown to the user will describe the wrong failure, making diagnosis difficult. Additionally, lookUpRelease is not awaited in a try/catch of its own here, so a throw from it silently replaces the error context. Consider catching errors from lookUpRelease separately.

Comment on lines +104 to +111
} catch (error) {
// A release published without its update manifest (latest.yml), or one
// the installer cannot read, should still be announced: fall back to
// the release page, and offer the download link instead of an install.
const fallback = await this.lookUpRelease();
if (fallback.status === 'available') return this.set({ ...fallback, mode: 'notify' });
return this.set({ status: 'error', ...this.base(), message: shortError(error) });
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Crash Risk: If lookUpRelease() throws (e.g., a network error during the fallback fetch), the exception escapes the outer catch block unhandled, leaving the service permanently in the 'checking' state. The user will see the spinner forever and cannot re-trigger a check, because check() guards against re-entry when status === 'checking'.

Wrap lookUpRelease() in its own try/catch so a failure there still transitions the state to 'error'.

Suggested change
} catch (error) {
// A release published without its update manifest (latest.yml), or one
// the installer cannot read, should still be announced: fall back to
// the release page, and offer the download link instead of an install.
const fallback = await this.lookUpRelease();
if (fallback.status === 'available') return this.set({ ...fallback, mode: 'notify' });
return this.set({ status: 'error', ...this.base(), message: shortError(error) });
}
} catch (error) {
// A release published without its update manifest (latest.yml), or one
// the installer cannot read, should still be announced: fall back to
// the release page, and offer the download link instead of an install.
try {
const fallback = await this.lookUpRelease();
if (fallback.status === 'available') return this.set({ ...fallback, mode: 'notify' });
} catch {
// fallback also failed; fall through to report the original error
}
return this.set({ status: 'error', ...this.base(), message: shortError(error) });
}

Review follow-up: favorite path keys lowercase only Windows paths, so
POSIX directories differing by case stay distinct (matches drag-drop's
sameLocation rule). The release workflow marks a tag prerelease only
when a hyphen follows the patch version, not anywhere in the tag name.

Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@SPhillips1337
SPhillips1337 merged commit 8a071f2 into main Nov 17, 2026
1 check passed
@SPhillips1337
SPhillips1337 deleted the feat/updates-favorites-dialog-dnd branch November 17, 2026 12:30
SPhillips1337 added a commit that referenced this pull request Nov 17, 2026
Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
@SPhillips1337

Copy link
Copy Markdown
Contributor Author

Review follow-up merged (60dbac6): favorite path keys now lowercase only Windows paths (POSIX case-distinct directories stay separate, matching drag-drop's sameLocation rule; +2 tests), and the release workflow marks prerelease only when a hyphen follows the patch version (v1.0-hotfix stays stable). The two update-service flags were checked against the code and are false positives: lookUpRelease() has its own try/catch and always returns an UpdateState, so it cannot throw into the outer catch or leave the service stuck in 'checking'. Merged as 8a071f2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant