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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RefreshIcon } from "~/components/ui/refresh-icon";
import { splitsSurrogatePair } from "@t3tools/shared/assistantCitations";
import { T, useGT, Var } from "gt-react";
import { PlusIcon, SearchIcon } from "lucide-react";

Expand Down Expand Up @@ -70,7 +71,8 @@ export function PullRequestListEmptyState({
onRefresh: () => void;
}) {
const gt = useGT();
const shownQuery = query.length > 48 ? `${query.slice(0, 48)}…` : query;
const shownQuery =
query.length > 48 ? `${query.slice(0, splitsSurrogatePair(query, 48) ? 47 : 48)}…` : query;
if (!hasProjects) {
return (
<Empty>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { expect } from "e2e";

import { test, WEB } from "./t3.ts";

const KEPT = "a".repeat(47);
// The emoji's two UTF-16 units straddle unit 48, where the shown search is cut.
const QUERY = `${KEPT}😀 and the rest of the search`;

test(
"A long pull request search that matches nothing ends without a broken character",
WEB,
async ({ t3, app, screen }) => {
await t3.project("demo");
await t3.open(`/pull-requests?${new URLSearchParams({ q: QUERY })}`);

const title = screen.getByText(/^Nothing matches/);
await title.waitFor({ timeout: 60_000 });
await app.screenshot("no-matches");
await expect(title).toHaveText(`Nothing matches “${KEPT}…”`);
},
);
Loading