fix(web): clear main branch lint warnings (#5384)
This commit is contained in:
1 parent
3d429662c9
commit
41ebf22eea
6 files changed
+30
-20
No files matched your search
@@ -1363,6 +1363,9 @@ function ChatMarkdown({
|
||||
},
|
||||
[createAssetUrl, openPreview, preparedConnection, threadRef],
|
||||
);
|
||||
/* eslint-disable react/no-unstable-nested-components -- ReactMarkdown requires component
|
||||
* renderers that close over this message's metadata. useMemo keeps them stable until that
|
||||
* metadata changes. */
|
||||
const markdownComponents = useMemo<Components>(() => {
|
||||
const fileLinkChip = (
|
||||
fileLinkMeta: MarkdownFileLinkMeta,
|
||||
@@ -1593,6 +1596,7 @@ function ChatMarkdown({
|
||||
text,
|
||||
threadRef,
|
||||
]);
|
||||
/* eslint-enable react/no-unstable-nested-components */
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -138,9 +138,20 @@ import {
|
||||
buildSidebarProjectPickerEntries,
|
||||
buildSidebarProjectSnapshots,
|
||||
} from "../sidebarProjectGrouping";
|
||||
import type { Project } from "../types";
|
||||
|
||||
const EMPTY_BROWSE_ENTRIES: FilesystemBrowseResult["entries"] = [];
|
||||
|
||||
function projectFavicon(project: Project) {
|
||||
return (
|
||||
<ProjectFavicon
|
||||
environmentId={project.environmentId}
|
||||
cwd={project.workspaceRoot}
|
||||
className={ITEM_ICON_CLASS}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function getLocalFileManagerName(platform: string): string {
|
||||
if (isMacPlatform(platform)) {
|
||||
return "Finder";
|
||||
@@ -924,13 +935,7 @@ function OpenCommandPaletteDialog(props: {
|
||||
group?.memberProjects.flatMap((member) => [member.title, member.workspaceRoot]) ?? []
|
||||
);
|
||||
},
|
||||
icon: (project) => (
|
||||
<ProjectFavicon
|
||||
environmentId={project.environmentId}
|
||||
cwd={project.workspaceRoot}
|
||||
className={ITEM_ICON_CLASS}
|
||||
/>
|
||||
),
|
||||
icon: projectFavicon,
|
||||
runProject: openProjectFromSearch,
|
||||
}),
|
||||
[openProjectFromSearch, pickerProjects, projectGroupByTargetKey],
|
||||
@@ -948,13 +953,7 @@ function OpenCommandPaletteDialog(props: {
|
||||
group?.memberProjects.flatMap((member) => [member.title, member.workspaceRoot]) ?? []
|
||||
);
|
||||
},
|
||||
icon: (project) => (
|
||||
<ProjectFavicon
|
||||
environmentId={project.environmentId}
|
||||
cwd={project.workspaceRoot}
|
||||
className={ITEM_ICON_CLASS}
|
||||
/>
|
||||
),
|
||||
icon: projectFavicon,
|
||||
runProject: async (project) => {
|
||||
const group = projectGroupByTargetKey.get(`${project.environmentId}:${project.id}`);
|
||||
const contextualRefBelongsToGroup =
|
||||
|
||||
@@ -129,7 +129,6 @@ export function FontFamilyPicker({
|
||||
if (initialOpen) setOpen(true);
|
||||
// The prop is only meaningful at mount - the control just swapped in
|
||||
// under an active focus - so later changes are deliberately ignored.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
const listRef = useRef<LegendListRef | null>(null);
|
||||
const enumeration = useFontEnumeration();
|
||||
|
||||
@@ -113,8 +113,8 @@ export function CodeFontPreview() {
|
||||
if (htmlByFile === null) return null;
|
||||
return (
|
||||
<div className="mt-1 mb-2 space-y-2">
|
||||
{htmlByFile.map((html, index) => (
|
||||
<StaticDiffHtml key={index} html={html} />
|
||||
{htmlByFile.map((html) => (
|
||||
<StaticDiffHtml key={html} html={html} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -116,7 +116,6 @@ import {
|
||||
isMonospaceFamily,
|
||||
resolveDefaultFamilyLabel,
|
||||
} from "../../appearanceFonts";
|
||||
import { DEFAULT_TERMINAL_FONT_FAMILY } from "~/terminal/ghostty/surface";
|
||||
import { CodeFontPreview, PromptFontPreview, TerminalFontPreview } from "./SettingsFontPreviews";
|
||||
import { discoverInstalledFonts, FontFamilyPicker, useFontEnumeration } from "./FontFamilyPicker";
|
||||
import {
|
||||
|
||||
@@ -19,6 +19,15 @@ import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
|
||||
import { Separator } from "../ui/separator";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
||||
|
||||
function keyReleaseNoteItems(items: ReadonlyArray<string>) {
|
||||
const occurrences = new Map<string, number>();
|
||||
return items.map((item) => {
|
||||
const occurrence = occurrences.get(item) ?? 0;
|
||||
occurrences.set(item, occurrence + 1);
|
||||
return { item, key: JSON.stringify([item, occurrence]) };
|
||||
});
|
||||
}
|
||||
|
||||
function SidebarUpdateReleaseNotesTooltip({
|
||||
state,
|
||||
tooltip,
|
||||
@@ -44,8 +53,8 @@ function SidebarUpdateReleaseNotesTooltip({
|
||||
{index === 0 ? "What's changed" : `Changes in ${releaseNote.version}`}
|
||||
</h3>
|
||||
<ul className="mt-2 space-y-1.5 pl-4 text-xs leading-5 text-popover-foreground/90">
|
||||
{releaseNote.items.map((item, itemIndex) => (
|
||||
<li className="list-disc break-words" key={`${releaseNote.version}-${itemIndex}`}>
|
||||
{keyReleaseNoteItems(releaseNote.items).map(({ item, key }) => (
|
||||
<li className="list-disc break-words" key={key}>
|
||||
{item}
|
||||
</li>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user