fix: inline comment continuity, unified-mode comment positioning, and macOS media prompt - #215
Merged
Conversation
The prior fix (6be1c60) gave the inline comment zones a reconcile-in-place controller, but two gaps remained that still interrupted an open inline editor on every poll: 1. useDiffComments called setComments() unconditionally, so an unchanged poll still produced a fresh comments array. That churned the mentionCandidates memo, whose identity change re-ran useDraftZones. Bail on structural equality (reuse sameCommentList, now extracted to a shared commentEquality module) so an unchanged poll keeps the old reference and downstream memos stay stable — mirroring what the activity view already does. 2. useDraftZones used the one-shot mountInlineZones, so a real drafts/ comments change tore down and rebuilt every DraftZone root, dropping an open draft editor's edit mode / focus / caret. Give it the same split structural/content effect + persistent createInlineZones controller as useCommentZones, reconciling draft zones by (side, line) key. A surviving draft re-renders in place (DraftZoneList keys by draft id); only a removed draft (deleted / published / file switch) unmounts and runs its cancel cleanup. The now-unused one-shot mountInlineZones wrapper is removed. The activity timeline already bailed via sameCommentList and needs no change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…o-degrade `renderSideBySide` threaded through the diff view is the toolbar *intent*, not the mode Monaco actually renders. When the pane is too narrow Monaco auto-degrades side-by-side → inline (useInlineViewWhenSpaceIsLimited) while the intent stays true, so old-side (base) items get routed to the original editor Monaco has hidden. A published old-side inline comment then had no visible position, and its glyph dot / overview tick vanished too. Introduce a single source of truth for the *actual* mode (useActualRenderSideBySide, reading Monaco's `.monaco-diff-editor.side-by-side` class reactively, the pattern useDiffOverviewMarks already used) and feed it to every consumer that positions by editor side: - DiffView passes the actual mode to useCommentZones / useDraftZones / useLineCommentAdder / useSelectionCapture (was the raw intent). - useCommentZones remaps old-side glyph/overview decorations onto the modified editor when actually inline (mirroring the zone-body routing in computeDesired) — this also fixes old-side markers in explicitly-chosen unified, a latent bug. - useDiffOverviewMarks reuses the shared isActualSideBySide helper. Also fix old-side anchor reveal, which was broken independently: the nav anchor dropped `side` (App/PrPanel/PublishReviewModal/notification) and useDiffNav hardcoded side:'new' with no old→new remap. Thread `side` through the anchor (incl. the notification:activate IPC event) and, at reveal time, read the live actual mode: an old-side target reveals on the original editor only when it is genuinely visible, otherwise remaps the old line onto the modified editor. The cross-file search jump reuses the same path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…prompt On macOS the app popped a "would like to access Apple Music, your music and video activity, and your media library" prompt on launch. It's not from packaging — no music entitlement and no NSAppleMusicUsageDescription are declared. It's runtime: Chromium's macOS "Now Playing" / media-session integration queries the MediaPlayer framework, which triggers the media library permission. The app plays no media and exposes no now-playing controls, so the permission is unexpected. Disable the MediaSessionService and HardwareMediaKeyHandling features (mac startup, before app.whenReady()) so Chromium never touches the media library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A batch of PR-review bug fixes.
1. Keep inline editors alive across a comments/drafts refresh (
fix(diff))A prior fix gave the inline comment zones a reconcile-in-place controller, but two gaps still interrupted an open inline editor on every poll:
useDiffCommentscalledsetComments()unconditionally, so an unchanged poll still produced a freshcommentsarray. That churned thementionCandidatesmemo, whose identity change re-ranuseDraftZones. Now it bails on structural equality (reusingsameCommentList, extracted to a sharedcommentEqualitymodule) so an unchanged poll keeps the old reference — mirroring what the activity view already does.useDraftZonesused the one-shot mount, so a real drafts/comments change tore down and rebuilt everyDraftZoneroot, dropping an open draft editor's edit mode / focus / caret. It now uses the same split structural/content effect + persistentcreateInlineZonescontroller asuseCommentZones, reconciling draft zones by(side, line)key. A surviving draft re-renders in place; only a removed draft (deleted / published / file switch) unmounts.The activity timeline already bailed via
sameCommentListand needs no change.2. Anchor inline comments to the actual render mode after auto-degrade (
fix(diff))renderSideBySidethreaded through the diff view is the toolbar intent, not the mode Monaco actually renders. When the pane is too narrow Monaco auto-degrades side-by-side → inline while the intent stays true, so old-side (base) items got routed to the original editor Monaco has hidden — a published old-side inline comment then had no visible position, and its glyph dot / overview tick vanished too.useActualRenderSideBySide, reading Monaco's.monaco-diff-editor.side-by-sideclass reactively) and feeds it touseCommentZones/useDraftZones/useLineCommentAdder/useSelectionCapture.useCommentZonesremaps old-side glyph/overview decorations onto the modified editor when actually inline (also fixes old-side markers in explicitly-chosen unified — a latent bug).side(App/PrPanel/PublishReviewModal/notification) anduseDiffNavhardcodedside:'new'with no remap.sideis now threaded through the anchor (incl. thenotification:activateIPC event) and, at reveal time, the live actual mode decides the target: an old-side reveal uses the original editor only when visible, otherwise remaps the old line onto the modified editor. The cross-file search jump reuses the same path.3. Stop the unexpected Apple Music / media-library permission prompt on macOS (
fix(mac))On macOS the app popped a "would like to access Apple Music, your music and video activity, and your media library" prompt on launch. Not from packaging (no music entitlement, no
NSAppleMusicUsageDescription): it's Chromium's macOS "Now Playing" / media-session integration querying the MediaPlayer framework. The app plays no media, so the permission is unexpected. Disables theMediaSessionServiceandHardwareMediaKeyHandlingfeatures at mac startup (beforeapp.whenReady()).Checks
lint+typecheck(all projects) +build(desktop) pass locally.