655 missing audio alert needs to be shown in navigation#720
655 missing audio alert needs to be shown in navigation#720
Conversation
…Display and in the MilestoneAccordion. - Code is set for both front and backend calculations for audio.
…amlined and efficient. - Have missing audio icon appear in Navigation view as well when there is missing audio in the folder and files.
… of isMissing across the codebase. - Update related functions and tests to ensure consistent behavior and improve clarity in audio state management.
…l cells in a document, ensuring accurate audio state management. - Updated CodexCellEditorProvider to utilize the new revalidation function, improving the accuracy of audio availability on initial load and during refresh. - Enhanced error handling and metadata persistence during the revalidation process.
…ument mutation - Replaced revalidation logic with new methods to compute audio availability for cells and attachments directly from the filesystem. - Introduced `computeCellAudioAvailabilityFromDisk` and `computeCellIdsAudioAvailability` functions to assess audio state without altering the document. - Updated message handling to send computed audio availability and history to the webview, ensuring accurate UI updates. - Enhanced tests to reflect changes in availability computation and document immutability.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Inconsistent missing audio count between progress computations
- Updated buildCorrectedMilestoneProgress to use cellHasMissingAudio directly, matching the logic in calculateMilestoneProgress for consistent missing audio counting.
- ✅ Fixed: Unused variable
wsin selectAudioAttachment handler- Removed the unused ws variable that was assigned via getWorkspaceFolder but never referenced after the refactor to metadata-based audio state computation.
- ✅ Fixed: Missing version gate in revalidateMissingForCell handler
- Applied applyFrontierVersionGate to the computed state before sending to webview, ensuring consistency with all other filesystem-based audio availability code paths.
Or push these changes by commenting:
@cursor push b0ba737937
Preview (b0ba737937)
diff --git a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts
--- a/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts
+++ b/src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts
@@ -21,7 +21,7 @@
import { getUnresolvedCommentsCountForCell } from "../../utils/commentsUtils";
import { toPosixPath } from "../../utils/pathUtils";
import { computeCellAudioAvailabilityFromDisk, computeCellIdsAudioAvailability } from "../../utils/audioMissingUtils";
-import { computeCellAudioStateWithVersionGate, type AudioAvailabilityState } from "../../utils/audioAvailabilityUtils";
+import { computeCellAudioStateWithVersionGate, applyFrontierVersionGate, type AudioAvailabilityState } from "../../utils/audioAvailabilityUtils";
import { mergeAudioFiles } from "../../utils/audioMerger";
import { getAttachmentDocumentSegmentFromUri } from "../../utils/attachmentFolderUtils";
// Comment out problematic imports
@@ -2484,7 +2484,6 @@
const cells = Array.isArray(notebookData?.cells) ? notebookData.cells : [];
const availability: Record<string, AudioAvailabilityState> = {};
let validatedByArray: ValidationEntry[] = [];
- const ws = vscode.workspace.getWorkspaceFolder(document.uri);
for (const cell of cells) {
const cellId = cell?.metadata?.id;
@@ -3117,7 +3116,8 @@
if (!workspaceFolder) return;
// Compute availability from disk without mutating or saving the document
- const state = await computeCellAudioAvailabilityFromDisk(document, workspaceFolder, cellId);
+ const rawState = await computeCellAudioAvailabilityFromDisk(document, workspaceFolder, cellId);
+ const state = await applyFrontierVersionGate(rawState);
safePostMessageToPanel(webviewPanel, {
type: "providerSendsAudioAttachments",
diff --git a/src/providers/codexCellEditorProvider/codexCellEditorProvider.ts b/src/providers/codexCellEditorProvider/codexCellEditorProvider.ts
--- a/src/providers/codexCellEditorProvider/codexCellEditorProvider.ts
+++ b/src/providers/codexCellEditorProvider/codexCellEditorProvider.ts
@@ -34,6 +34,7 @@
import { getAuthApi } from "@/extension";
import { computeCellAudioStateWithVersionGate, type AudioAvailabilityState } from "../../utils/audioAvailabilityUtils";
import { computeCellIdsAudioAvailability, computeDocumentAudioAvailability } from "../../utils/audioMissingUtils";
+import { cellHasMissingAudio } from "../../../sharedUtils";
import {
getCachedChapter as getCachedChapterUtil,
updateCachedChapter as updateCachedChapterUtil,
@@ -114,8 +115,8 @@
let missingCount = 0;
for (let j = startIdx; j < endIdx && j < documentCells.length; j++) {
- const cellId = documentCells[j]?.metadata?.id;
- if (cellId && availability[cellId] === "missing") {
+ const cell = documentCells[j];
+ if (cell && cellHasMissingAudio(cell.metadata?.attachments, cell.metadata?.selectedAudioId)) {
missingCount++;
}
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
src/providers/codexCellEditorProvider/codexCellEditorMessagehandling.ts
Outdated
Show resolved
Hide resolved
- Applied applyFrontierVersionGate to the computed state before sending to webview, ensuring consistency with all other filesystem-based audio availability code paths.
…itorProvider/codexCellEditorProvider.ts to use the same missing-audio semantics as initial progress, while still honoring filesystem-derived correction
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
- Enhance attachment metadata handling by adding revalidation functions. - Implemented revalidateCellAttachmentAvailability and revalidateDocumentAttachmentAvailability to ensure audio attachment availability is accurately reflected from the filesystem. - Updated document saving logic to trigger when metadata changes occur, improving consistency in audio history and availability states.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |


Refactor audio availability handling to compute from disk without document mutation
Replaced revalidation logic with new methods to compute audio availability for cells and attachments directly from the filesystem.
Introduced computeCellAudioAvailabilityFromDisk and computeCellIdsAudioAvailability functions to assess audio state without altering the document.
Updated message handling to send computed audio availability and history to the webview, ensuring accurate UI updates.
Enhanced tests to reflect changes in availability computation and document immutability.
Note
Medium Risk
Touches attachment data model and audio availability computation across provider, migrations, merge/export, and UI progress indicators; regressions could mislabel audio states or skew milestone/nav progress until metadata is fully migrated.
Overview
Replaces the legacy
isMissingboolean with a richer persistedaudioAvailabilityfield (available-local/available-pointer/missing) and centralizes availability logic in newaudioAvailabilityUtils(metadata-only reads plus a write-timedetermineAttachmentAvailabilitydisk check).Refactors providers/handlers to stop doing ad-hoc filesystem checks and instead (a) set
audioAvailabilityon new/merged/stream-saved attachments, and (b) compute and message filesystem-checked availability to webviews for visible pages, initial load, and post-sync refresh without mutating the document.Extends progress reporting with
cellsWithMissingAudioand updates editor + navigation UIs to surface missing-audio alerts (including milestone/subsection indicators), while updating migration, merge resolution, exporter filtering, importers, and tests to understandaudioAvailabilitywith a deprecatedisMissingfallback.Written by Cursor Bugbot for commit 4c0ecd9. This will update automatically on new commits. Configure here.