Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/components/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1593,6 +1596,7 @@ function ChatMarkdown({
text,
threadRef,
]);
/* eslint-enable react/no-unstable-nested-components */

return (
<div
Expand Down
27 changes: 13 additions & 14 deletions apps/web/src/components/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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],
Expand All @@ -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 =
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/components/settings/FontFamilyPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/settings/SettingsFontPreviews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/components/settings/SettingsPanels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 11 additions & 2 deletions apps/web/src/components/sidebar/SidebarUpdatePill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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>
))}
Expand Down
Loading