Skip to content

Commit f6e8762

Browse files
fix(preview): qualify blank-tab guidance for new tabs
1 parent f2a644f commit f6e8762

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎packages/contracts/src/preview.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export class PreviewInvalidUrlError extends Schema.TaggedError<PreviewInvalidUrl
367367
) {
368368
override get message() {
369369
const protocol = this.protocol === undefined ? "" : `: ${this.protocol}`;
370-
return `Invalid preview URL (${this.reason}${protocol}; input length ${this.inputLength}). Use an http(s) URL or a schemeless host such as localhost:5173. With preview_open, omit url to open a blank tab.`;
370+
return `Invalid preview URL (${this.reason}${protocol}; input length ${this.inputLength}). Use an http(s) URL or a schemeless host such as localhost:5173. With preview_open, omit url when creating a new tab to open a blank tab.`;
371371
}
372372
}
373373

‎packages/shared/src/preview.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe("resolveSearchUrlTemplate", () => {
151151
describe("normalizePreviewUrl", () => {
152152
it("tells agents how to open a blank tab and which URLs are accepted", () => {
153153
expect(() => normalizePreviewUrl("about:blank")).toThrow(
154-
/preview_open, omit url[^.]*blank tab/i,
154+
/preview_open, omit url when creating a new tab[^.]*blank tab/i,
155155
);
156156
expect(() => normalizePreviewUrl("about:blank")).toThrow(/http\(s\)/i);
157157
expect(() => normalizePreviewUrl("about:blank")).toThrow(/schemeless host/i);

‎packages/shared/src/preview.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class PreviewUrlNormalizationError extends Schema.TaggedError<PreviewUrlN
6666
) {
6767
override get message(): string {
6868
const protocol = this.protocol === undefined ? "" : `: ${this.protocol}`;
69-
return `Invalid preview URL (${this.reason}${protocol}; input length ${this.inputLength}). Use an http(s) URL or a schemeless host such as localhost:5173. With preview_open, omit url to open a blank tab.`;
69+
return `Invalid preview URL (${this.reason}${protocol}; input length ${this.inputLength}). Use an http(s) URL or a schemeless host such as localhost:5173. With preview_open, omit url when creating a new tab to open a blank tab.`;
7070
}
7171
}
7272

0 commit comments

Comments
 (0)