chore: Prettier fix formatting

This commit is contained in:
Saoud Rizwan committed 2025-01-06 12:41:33 -08:00
1 parent 9de7253998
commit 25cd7cc8e2
106 files changed
+1624 -5278

No files matched your search

@@ -14,8 +14,7 @@ interface CheckpointOverlayProps {
export const CheckpointOverlay = ({ messageTs }: CheckpointOverlayProps) => {
const [compareDisabled, setCompareDisabled] = useState(false)
const [restoreTaskDisabled, setRestoreTaskDisabled] = useState(false)
const [restoreWorkspaceDisabled, setRestoreWorkspaceDisabled] =
useState(false)
const [restoreWorkspaceDisabled, setRestoreWorkspaceDisabled] = useState(false)
const [restoreBothDisabled, setRestoreBothDisabled] = useState(false)
const [showRestoreConfirm, setShowRestoreConfirm] = useState(false)
const [hasMouseEntered, setHasMouseEntered] = useState(false)
@@ -118,10 +117,7 @@ export const CheckpointOverlay = ({ messageTs }: CheckpointOverlayProps) => {
number: messageTs,
})
}}>
<i
className="codicon codicon-diff-multiple"
style={{ position: "absolute" }}
/>
<i className="codicon codicon-diff-multiple" style={{ position: "absolute" }} />
</VSCodeButton>
<div style={{ position: "relative" }} ref={containerRef}>
<VSCodeButton
@@ -129,64 +125,42 @@ export const CheckpointOverlay = ({ messageTs }: CheckpointOverlayProps) => {
appearance="secondary"
style={{ cursor: "pointer" }}
onClick={() => setShowRestoreConfirm(true)}>
<i
className="codicon codicon-discard"
style={{ position: "absolute" }}
/>
<i className="codicon codicon-discard" style={{ position: "absolute" }} />
</VSCodeButton>
{showRestoreConfirm && (
<RestoreConfirmTooltip
ref={tooltipRef}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}>
<RestoreConfirmTooltip ref={tooltipRef} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>
<RestoreOption>
<VSCodeButton
onClick={handleRestoreBoth}
disabled={restoreBothDisabled}
style={{
cursor: restoreBothDisabled
? "wait"
: "pointer",
cursor: restoreBothDisabled ? "wait" : "pointer",
}}>
Restore Task and Workspace
</VSCodeButton>
<p>
Restores the task and your project's files back
to a snapshot taken at this point
</p>
<p>Restores the task and your project's files back to a snapshot taken at this point</p>
</RestoreOption>
<RestoreOption>
<VSCodeButton
onClick={handleRestoreTask}
disabled={restoreTaskDisabled}
style={{
cursor: restoreTaskDisabled
? "wait"
: "pointer",
cursor: restoreTaskDisabled ? "wait" : "pointer",
}}>
Restore Task Only
</VSCodeButton>
<p>
Deletes messages after this point (does not
affect workspace)
</p>
<p>Deletes messages after this point (does not affect workspace)</p>
</RestoreOption>
<RestoreOption>
<VSCodeButton
onClick={handleRestoreWorkspace}
disabled={restoreWorkspaceDisabled}
style={{
cursor: restoreWorkspaceDisabled
? "wait"
: "pointer",
cursor: restoreWorkspaceDisabled ? "wait" : "pointer",
}}>
Restore Workspace Only
</VSCodeButton>
<p>
Restores your project's files to a snapshot
taken at this point (task may become out of
sync)
</p>
<p>Restores your project's files to a snapshot taken at this point (task may become out of sync)</p>
</RestoreOption>
</RestoreConfirmTooltip>
)}
@@ -20,8 +20,7 @@ We need to remove leading non-alphanumeric characters from the path in order for
[^a-zA-Z0-9]+: Matches one or more characters that are not alphanumeric.
The replace method removes these matched characters, effectively trimming the string up to the first alphanumeric character.
*/
export const removeLeadingNonAlphanumeric = (path: string): string =>
path.replace(/^[^a-zA-Z0-9]+/, "")
export const removeLeadingNonAlphanumeric = (path: string): string => path.replace(/^[^a-zA-Z0-9]+/, "")
const CodeAccordian = ({
code,
@@ -35,9 +34,7 @@ const CodeAccordian = ({
isLoading,
}: CodeAccordianProps) => {
const inferredLanguage = useMemo(
() =>
code &&
(language ?? (path ? getLanguageFromPath(path) : undefined)),
() => code && (language ?? (path ? getLanguageFromPath(path) : undefined)),
[path, language, code],
)
@@ -93,14 +90,12 @@ const CodeAccordian = ({
direction: "rtl",
textAlign: "left",
}}>
{removeLeadingNonAlphanumeric(path ?? "") +
"\u200E"}
{removeLeadingNonAlphanumeric(path ?? "") + "\u200E"}
</span>
</>
)}
<div style={{ flexGrow: 1 }}></div>
<span
className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
</div>
)}
{(!(path || isFeedback || isConsoleLogs) || isExpanded) && (
+4 -12
View File
@@ -5,8 +5,7 @@ import styled from "styled-components"
import { visit } from "unist-util-visit"
import { useExtensionState } from "../../context/ExtensionStateContext"
export const CODE_BLOCK_BG_COLOR =
"var(--vscode-editor-background, --vscode-sideBar-background, rgb(30 30 30))"
export const CODE_BLOCK_BG_COLOR = "var(--vscode-editor-background, --vscode-sideBar-background, rgb(30 30 30))"
/*
overflowX: auto + inner div with padding results in an issue where the top/left/bottom padding renders but the right padding inside does not count as overflow as the width of the element is not exceeded. Once the inner div is outside the boundaries of the parent it counts as overflow.
@@ -60,10 +59,7 @@ const StyledMarkdown = styled.div<{ forceWrap: boolean }>`
word-wrap: break-word;
border-radius: 5px;
background-color: ${CODE_BLOCK_BG_COLOR};
font-size: var(
--vscode-editor-font-size,
var(--vscode-font-size, 12px)
);
font-size: var(--vscode-editor-font-size, var(--vscode-font-size, 12px));
font-family: var(--vscode-editor-font-family);
}
@@ -139,9 +135,7 @@ const CodeBlock = memo(({ source, forceWrap = false }: CodeBlockProps) => {
],
rehypeReactOptions: {
components: {
pre: ({ node, ...preProps }: any) => (
<StyledPre {...preProps} theme={theme} />
),
pre: ({ node, ...preProps }: any) => <StyledPre {...preProps} theme={theme} />,
},
},
})
@@ -157,9 +151,7 @@ const CodeBlock = memo(({ source, forceWrap = false }: CodeBlockProps) => {
maxHeight: forceWrap ? "none" : "100%",
backgroundColor: CODE_BLOCK_BG_COLOR,
}}>
<StyledMarkdown forceWrap={forceWrap}>
{reactContent}
</StyledMarkdown>
<StyledMarkdown forceWrap={forceWrap}>{reactContent}</StyledMarkdown>
</div>
)
})
+12 -36
View File
@@ -57,67 +57,43 @@ function Demo() {
<div className="grid gap-3 p-2 place-items-start">
<VSCodeDataGrid>
<VSCodeDataGridRow row-type="header">
<VSCodeDataGridCell
cell-type="columnheader"
grid-column="1">
<VSCodeDataGridCell cell-type="columnheader" grid-column="1">
A Custom Header Title
</VSCodeDataGridCell>
<VSCodeDataGridCell
cell-type="columnheader"
grid-column="2">
<VSCodeDataGridCell cell-type="columnheader" grid-column="2">
Another Custom Title
</VSCodeDataGridCell>
<VSCodeDataGridCell
cell-type="columnheader"
grid-column="3">
<VSCodeDataGridCell cell-type="columnheader" grid-column="3">
Title Is Custom
</VSCodeDataGridCell>
<VSCodeDataGridCell
cell-type="columnheader"
grid-column="4">
<VSCodeDataGridCell cell-type="columnheader" grid-column="4">
Custom Title
</VSCodeDataGridCell>
</VSCodeDataGridRow>
{rowData.map((row, index) => (
<VSCodeDataGridRow key={index}>
<VSCodeDataGridCell grid-column="1">
{row.cell1}
</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="2">
{row.cell2}
</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="3">
{row.cell3}
</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="4">
{row.cell4}
</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="1">{row.cell1}</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="2">{row.cell2}</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="3">{row.cell3}</VSCodeDataGridCell>
<VSCodeDataGridCell grid-column="4">{row.cell4}</VSCodeDataGridCell>
</VSCodeDataGridRow>
))}
</VSCodeDataGrid>
<VSCodeTextField>
<section
slot="end"
style={{ display: "flex", alignItems: "center" }}>
<section slot="end" style={{ display: "flex", alignItems: "center" }}>
<VSCodeButton appearance="icon" aria-label="Match Case">
<span className="codicon codicon-case-sensitive"></span>
</VSCodeButton>
<VSCodeButton
appearance="icon"
aria-label="Match Whole Word">
<VSCodeButton appearance="icon" aria-label="Match Whole Word">
<span className="codicon codicon-whole-word"></span>
</VSCodeButton>
<VSCodeButton
appearance="icon"
aria-label="Use Regular Expression">
<VSCodeButton appearance="icon" aria-label="Use Regular Expression">
<span className="codicon codicon-regex"></span>
</VSCodeButton>
</section>
</VSCodeTextField>
<span
slot="end"
className="codicon codicon-chevron-right"></span>
<span slot="end" className="codicon codicon-chevron-right"></span>
<span className="flex gap-3">
<VSCodeProgressRing />
@@ -81,10 +81,7 @@ const StyledMarkdown = styled.div`
word-wrap: break-word;
border-radius: 3px;
background-color: ${CODE_BLOCK_BG_COLOR};
font-size: var(
--vscode-editor-font-size,
var(--vscode-font-size, 12px)
);
font-size: var(--vscode-editor-font-size, var(--vscode-font-size, 12px));
font-family: var(--vscode-editor-font-family);
}
@@ -184,9 +181,7 @@ const MarkdownBlock = memo(({ markdown }: MarkdownBlockProps) => {
],
rehypeReactOptions: {
components: {
pre: ({ node, ...preProps }: any) => (
<StyledPre {...preProps} theme={theme} />
),
pre: ({ node, ...preProps }: any) => <StyledPre {...preProps} theme={theme} />,
},
},
})
@@ -21,8 +21,7 @@ const StyledButton = styled(VSCodeButton)`
}
`
interface SuccessButtonProps
extends React.ComponentProps<typeof VSCodeButton> {}
interface SuccessButtonProps extends React.ComponentProps<typeof VSCodeButton> {}
const SuccessButton: React.FC<SuccessButtonProps> = (props) => {
return <StyledButton {...props} />
@@ -9,12 +9,7 @@ interface ThumbnailsProps {
onHeightChange?: (height: number) => void
}
const Thumbnails = ({
images,
style,
setImages,
onHeightChange,
}: ThumbnailsProps) => {
const Thumbnails = ({ images, style, setImages, onHeightChange }: ThumbnailsProps) => {
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null)
const containerRef = useRef<HTMLDivElement>(null)
const { width } = useWindowSize()
@@ -79,8 +74,7 @@ const Thumbnails = ({
width: 13,
height: 13,
borderRadius: "50%",
backgroundColor:
"var(--vscode-badge-background)",
backgroundColor: "var(--vscode-badge-background)",
display: "flex",
justifyContent: "center",
alignItems: "center",
@@ -7,11 +7,7 @@ interface VSCodeButtonLinkProps {
[key: string]: any
}
const VSCodeButtonLink: React.FC<VSCodeButtonLinkProps> = ({
href,
children,
...props
}) => {
const VSCodeButtonLink: React.FC<VSCodeButtonLinkProps> = ({ href, children, ...props }) => {
return (
<a
href={href}