fix: Update RightPanel test assertions for task progress format

Changed format from "X / Y total tasks completed" to "X of Y tasks completed"
to match updated component text.
This commit is contained in:
Pedram Amini
2025-12-13 22:18:32 -06:00
parent a952bd8d9f
commit 56ffd81b87
4 changed files with 143 additions and 28 deletions

138
package-lock.json generated
View File

@@ -36,6 +36,7 @@
"react-markdown": "^10.1.0",
"react-syntax-highlighter": "^16.1.0",
"react-virtuoso": "^4.15.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"ws": "^8.16.0"
},
@@ -7802,6 +7803,26 @@
"node": ">= 0.4"
}
},
"node_modules/hast-util-from-parse5": {
"version": "8.0.3",
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz",
"integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"@types/unist": "^3.0.0",
"devlop": "^1.0.0",
"hastscript": "^9.0.0",
"property-information": "^7.0.0",
"vfile": "^6.0.0",
"vfile-location": "^5.0.0",
"web-namespaces": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-parse-selector": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz",
@@ -7815,6 +7836,55 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-raw": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz",
"integrity": "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"@types/unist": "^3.0.0",
"@ungap/structured-clone": "^1.0.0",
"hast-util-from-parse5": "^8.0.0",
"hast-util-to-parse5": "^8.0.0",
"html-void-elements": "^3.0.0",
"mdast-util-to-hast": "^13.0.0",
"parse5": "^7.0.0",
"unist-util-position": "^5.0.0",
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.0",
"web-namespaces": "^2.0.0",
"zwitch": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-raw/node_modules/entities": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=0.12"
},
"funding": {
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/hast-util-raw/node_modules/parse5": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
"integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
"license": "MIT",
"dependencies": {
"entities": "^6.0.0"
},
"funding": {
"url": "https://github.com/inikulin/parse5?sponsor=1"
}
},
"node_modules/hast-util-to-jsx-runtime": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz",
@@ -7842,6 +7912,25 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-to-parse5": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz",
"integrity": "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"comma-separated-tokens": "^2.0.0",
"devlop": "^1.0.0",
"property-information": "^7.0.0",
"space-separated-tokens": "^2.0.0",
"web-namespaces": "^2.0.0",
"zwitch": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/hast-util-whitespace": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz",
@@ -7950,6 +8039,16 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/html-void-elements": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz",
"integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/http-cache-semantics": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz",
@@ -11912,6 +12011,21 @@
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/rehype-raw": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz",
"integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"hast-util-raw": "^9.0.0",
"vfile": "^6.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/remark-gfm": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz",
@@ -13653,6 +13767,20 @@
"url": "https://opencollective.com/unified"
}
},
"node_modules/vfile-location": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz",
"integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==",
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
"vfile": "^6.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
}
},
"node_modules/vfile-message": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz",
@@ -14935,6 +15063,16 @@
"defaults": "^1.0.3"
}
},
"node_modules/web-namespaces": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz",
"integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/webidl-conversions": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-8.0.0.tgz",

View File

@@ -151,6 +151,7 @@
"react-markdown": "^10.1.0",
"react-syntax-highlighter": "^16.1.0",
"react-virtuoso": "^4.15.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^4.0.1",
"ws": "^8.16.0"
},

View File

@@ -618,7 +618,7 @@ describe('RightPanel', () => {
const props = createDefaultProps({ currentSessionBatchState });
render(<RightPanel {...props} />);
expect(screen.getByText('7 / 20 total tasks completed')).toBeInTheDocument();
expect(screen.getByText('7 of 20 tasks completed')).toBeInTheDocument();
});
it('should show single document task count when totalTasksAcrossAllDocs is 0', () => {
@@ -639,7 +639,7 @@ describe('RightPanel', () => {
const props = createDefaultProps({ currentSessionBatchState });
render(<RightPanel {...props} />);
expect(screen.getByText('5 / 10 tasks completed')).toBeInTheDocument();
expect(screen.getByText('5 of 10 tasks completed')).toBeInTheDocument();
});
it('should show loading spinner during batch run', () => {

View File

@@ -1,6 +1,7 @@
import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import rehypeRaw from 'rehype-raw';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { FileCode, X, Copy, FileText, Eye, ChevronUp, ChevronDown, Clipboard, Loader2, Image, Globe, Save, Edit, FolderOpen } from 'lucide-react';
@@ -320,7 +321,6 @@ export function FilePreview({ file, onClose, theme, markdownEditMode, setMarkdow
const [searchQuery, setSearchQuery] = useState('');
const [searchOpen, setSearchOpen] = useState(false);
const [showCopyNotification, setShowCopyNotification] = useState(false);
const [hoveredLink, setHoveredLink] = useState<{ url: string; x: number; y: number } | null>(null);
const [currentMatchIndex, setCurrentMatchIndex] = useState(0);
const [totalMatches, setTotalMatches] = useState(0);
const [fileStats, setFileStats] = useState<FileStats | null>(null);
@@ -1103,8 +1103,7 @@ export function FilePreview({ file, onClose, theme, markdownEditMode, setMarkdow
`}</style>
<ReactMarkdown
remarkPlugins={[remarkGfm, remarkHighlight]}
rehypePlugins={[]}
skipHtml={false}
rehypePlugins={[rehypeRaw]}
components={{
a: ({ node, href, children, ...props }) => (
<a
@@ -1116,13 +1115,6 @@ export function FilePreview({ file, onClose, theme, markdownEditMode, setMarkdow
window.maestro.shell.openExternal(href);
}
}}
onMouseEnter={(e) => {
if (href) {
const rect = e.currentTarget.getBoundingClientRect();
setHoveredLink({ url: href, x: rect.left, y: rect.bottom });
}
}}
onMouseLeave={() => setHoveredLink(null)}
style={{ color: theme.colors.accent, textDecoration: 'underline', cursor: 'pointer' }}
>
{children}
@@ -1207,22 +1199,6 @@ export function FilePreview({ file, onClose, theme, markdownEditMode, setMarkdow
</div>
)}
{/* Link Hover Tooltip */}
{hoveredLink && (
<div
className="fixed px-3 py-2 rounded shadow-lg text-xs font-mono max-w-md break-all z-50"
style={{
left: `${hoveredLink.x}px`,
top: `${hoveredLink.y + 5}px`,
backgroundColor: theme.colors.bgActivity,
color: theme.colors.textDim,
border: `1px solid ${theme.colors.border}`,
pointerEvents: 'none'
}}
>
{hoveredLink.url}
</div>
)}
</div>
);
}