Skip to content

Commit db0db83

Browse files
authored
Merge branch 'main' into agent/fix-mobile-project-grouping
2 parents 98d00c3 + 41ebf22 commit db0db83

8 files changed

Lines changed: 52 additions & 31 deletions

File tree

‎apps/server/src/mcp/toolkits/preview/tools.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@ const schemaHasDescription = (schema: unknown): boolean => {
1212
.some((members) => members.some(schemaHasDescription));
1313
};
1414

15+
const schemaHasMultipleAllOfDescriptions = (schema: unknown): boolean => {
16+
if (!schema || typeof schema !== "object") return false;
17+
const record = schema as Record<string, unknown>;
18+
const allOf = Array.isArray(record.allOf) ? record.allOf : [];
19+
const descriptionCount = allOf.filter(
20+
(member) =>
21+
member !== null &&
22+
typeof member === "object" &&
23+
typeof (member as Record<string, unknown>).description === "string",
24+
).length;
25+
return descriptionCount > 1 || Object.values(record).some(schemaHasMultipleAllOfDescriptions);
26+
};
27+
1528
it("exports provider-compatible object schemas with described parameters", () => {
1629
for (const tool of Object.values(PreviewToolkit.tools)) {
1730
const schema = Tool.getJsonSchema(tool) as {
@@ -27,6 +40,9 @@ it("exports provider-compatible object schemas with described parameters", () =>
2740
expect(schema.type, `${tool.name} must export a top-level object schema`).toBe("object");
2841
expect(schema.anyOf, `${tool.name} must not export a root anyOf`).toBeUndefined();
2942
expect(schema.oneOf, `${tool.name} must not export a root oneOf`).toBeUndefined();
43+
if (tool.name === "preview_navigate") {
44+
expect(schemaHasMultipleAllOfDescriptions(schema)).toBe(false);
45+
}
3046
expect(
3147
schema.properties?.tabId,
3248
`${tool.name} must allow an explicit collaborative browser tab target`,

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,6 +1363,9 @@ function ChatMarkdown({
13631363
},
13641364
[createAssetUrl, openPreview, preparedConnection, threadRef],
13651365
);
1366+
/* eslint-disable react/no-unstable-nested-components -- ReactMarkdown requires component
1367+
* renderers that close over this message's metadata. useMemo keeps them stable until that
1368+
* metadata changes. */
13661369
const markdownComponents = useMemo<Components>(() => {
13671370
const fileLinkChip = (
13681371
fileLinkMeta: MarkdownFileLinkMeta,
@@ -1593,6 +1596,7 @@ function ChatMarkdown({
15931596
text,
15941597
threadRef,
15951598
]);
1599+
/* eslint-enable react/no-unstable-nested-components */
15961600

15971601
return (
15981602
<div

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,20 @@ import {
138138
buildSidebarProjectPickerEntries,
139139
buildSidebarProjectSnapshots,
140140
} from "../sidebarProjectGrouping";
141+
import type { Project } from "../types";
141142

142143
const EMPTY_BROWSE_ENTRIES: FilesystemBrowseResult["entries"] = [];
143144

145+
function projectFavicon(project: Project) {
146+
return (
147+
<ProjectFavicon
148+
environmentId={project.environmentId}
149+
cwd={project.workspaceRoot}
150+
className={ITEM_ICON_CLASS}
151+
/>
152+
);
153+
}
154+
144155
function getLocalFileManagerName(platform: string): string {
145156
if (isMacPlatform(platform)) {
146157
return "Finder";
@@ -924,13 +935,7 @@ function OpenCommandPaletteDialog(props: {
924935
group?.memberProjects.flatMap((member) => [member.title, member.workspaceRoot]) ?? []
925936
);
926937
},
927-
icon: (project) => (
928-
<ProjectFavicon
929-
environmentId={project.environmentId}
930-
cwd={project.workspaceRoot}
931-
className={ITEM_ICON_CLASS}
932-
/>
933-
),
938+
icon: projectFavicon,
934939
runProject: openProjectFromSearch,
935940
}),
936941
[openProjectFromSearch, pickerProjects, projectGroupByTargetKey],
@@ -948,13 +953,7 @@ function OpenCommandPaletteDialog(props: {
948953
group?.memberProjects.flatMap((member) => [member.title, member.workspaceRoot]) ?? []
949954
);
950955
},
951-
icon: (project) => (
952-
<ProjectFavicon
953-
environmentId={project.environmentId}
954-
cwd={project.workspaceRoot}
955-
className={ITEM_ICON_CLASS}
956-
/>
957-
),
956+
icon: projectFavicon,
958957
runProject: async (project) => {
959958
const group = projectGroupByTargetKey.get(`${project.environmentId}:${project.id}`);
960959
const contextualRefBelongsToGroup =

‎apps/web/src/components/settings/FontFamilyPicker.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export function FontFamilyPicker({
129129
if (initialOpen) setOpen(true);
130130
// The prop is only meaningful at mount - the control just swapped in
131131
// under an active focus - so later changes are deliberately ignored.
132-
// eslint-disable-next-line react-hooks/exhaustive-deps
133132
}, []);
134133
const listRef = useRef<LegendListRef | null>(null);
135134
const enumeration = useFontEnumeration();

‎apps/web/src/components/settings/SettingsFontPreviews.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export function CodeFontPreview() {
113113
if (htmlByFile === null) return null;
114114
return (
115115
<div className="mt-1 mb-2 space-y-2">
116-
{htmlByFile.map((html, index) => (
117-
<StaticDiffHtml key={index} html={html} />
116+
{htmlByFile.map((html) => (
117+
<StaticDiffHtml key={html} html={html} />
118118
))}
119119
</div>
120120
);

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ import {
116116
isMonospaceFamily,
117117
resolveDefaultFamilyLabel,
118118
} from "../../appearanceFonts";
119-
import { DEFAULT_TERMINAL_FONT_FAMILY } from "~/terminal/ghostty/surface";
120119
import { CodeFontPreview, PromptFontPreview, TerminalFontPreview } from "./SettingsFontPreviews";
121120
import { discoverInstalledFonts, FontFamilyPicker, useFontEnumeration } from "./FontFamilyPicker";
122121
import {

‎apps/web/src/components/sidebar/SidebarUpdatePill.tsx‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ import { Alert, AlertDescription, AlertTitle } from "../ui/alert";
1919
import { Separator } from "../ui/separator";
2020
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
2121

22+
function keyReleaseNoteItems(items: ReadonlyArray<string>) {
23+
const occurrences = new Map<string, number>();
24+
return items.map((item) => {
25+
const occurrence = occurrences.get(item) ?? 0;
26+
occurrences.set(item, occurrence + 1);
27+
return { item, key: JSON.stringify([item, occurrence]) };
28+
});
29+
}
30+
2231
function SidebarUpdateReleaseNotesTooltip({
2332
state,
2433
tooltip,
@@ -44,8 +53,8 @@ function SidebarUpdateReleaseNotesTooltip({
4453
{index === 0 ? "What's changed" : `Changes in ${releaseNote.version}`}
4554
</h3>
4655
<ul className="mt-2 space-y-1.5 pl-4 text-xs leading-5 text-popover-foreground/90">
47-
{releaseNote.items.map((item, itemIndex) => (
48-
<li className="list-disc break-words" key={`${releaseNote.version}-${itemIndex}`}>
56+
{keyReleaseNoteItems(releaseNote.items).map(({ item, key }) => (
57+
<li className="list-disc break-words" key={key}>
4958
{item}
5059
</li>
5160
))}

‎packages/contracts/src/previewAutomation.ts‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@ import {
1212
import { ProviderInstanceId } from "./providerInstance.ts";
1313

1414
const BoundedUrl = Schema.String.check(Schema.isTrimmed())
15-
.check(
16-
Schema.isNonEmpty({
17-
description:
18-
"Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http.",
19-
}),
20-
)
15+
.check(Schema.isNonEmpty())
2116
.check(Schema.isMaxLength(2048));
17+
const URL_GUIDANCE =
18+
"Absolute http(s) URL or a schemeless host such as t3.chat or localhost:5173. Schemeless public hosts use https; loopback hosts use http.";
2219
const OptionalTimeoutMs = Schema.optional(
2320
Schema.Int.check(Schema.isGreaterThan(0))
2421
.check(Schema.isLessThanOrEqualTo(60_000))
@@ -83,8 +80,7 @@ export type PreviewAutomationStatus = typeof PreviewAutomationStatus.Type;
8380
export const PreviewAutomationOpenInput = Schema.Struct({
8481
...PreviewAutomationTabTargetFields,
8582
url: Schema.optional(BoundedUrl).annotate({
86-
description:
87-
"Optional initial page URL, for example https://t3.chat or localhost:5173. Omit to open a blank tab.",
83+
description: `Optional initial page URL. ${URL_GUIDANCE} Omit to open a blank tab.`,
8884
}),
8985
open: Schema.optional(
9086
Schema.Boolean.annotate({
@@ -124,7 +120,7 @@ export const BrowserNavigationTarget = Schema.Union([
124120
description: "Selects direct URL navigation.",
125121
}),
126122
url: BoundedUrl.annotate({
127-
description: "Direct website URL.",
123+
description: `Direct website URL. ${URL_GUIDANCE}`,
128124
}),
129125
}),
130126
Schema.Struct({
@@ -151,8 +147,7 @@ export type BrowserNavigationTarget = typeof BrowserNavigationTarget.Type;
151147
export const PreviewAutomationNavigateInput = Schema.Struct({
152148
...PreviewAutomationTabTargetFields,
153149
url: Schema.optional(BoundedUrl).annotate({
154-
description:
155-
"Website URL, for example https://t3.chat. Use this for public pages and directly reachable URLs.",
150+
description: `Website URL. ${URL_GUIDANCE} Use this for public pages and directly reachable URLs.`,
156151
}),
157152
target: Schema.optional(
158153
BrowserNavigationTarget.annotate({

0 commit comments

Comments
 (0)