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
2 changes: 2 additions & 0 deletions plugins/stewards/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ function SidebarThreadRow({
<a
href={thread.href}
className="min-w-0 flex-1 truncate text-sm"
title={thread.displayTitle}
onClick={(e) => {
e.preventDefault();
navigate.toThread(thread.id);
Expand Down Expand Up @@ -1319,6 +1320,7 @@ function SidebarEffortRow({
<a
href={root.href}
className="flex min-w-0 flex-1 items-baseline gap-1 text-sm"
title={root.displayTitle}
onClick={(e) => {
e.preventDefault();
navigate.toThread(root.id);
Expand Down
21 changes: 21 additions & 0 deletions plugins/stewards/sidebar-app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ describe("the stewards sidebar list (BB-44)", () => {
slot.lifecycle.unmount();
});

// BB-84: a truncated title is still readable on hover, through the native
// `title` tooltip on the row's title anchor.
it("puts the thread's full display title on the row's title anchor as a tooltip", async () => {
const plainTitle = "A one-off thread whose long title the sidebar truncates";
const slot = await renderSidebar({
sidebarThreads: {
projects,
threads: [thread({ id: "thr_steward", displayTitle: "ENG-1: Fix login" }), thread({ id: "thr_oneoff", displayTitle: plainTitle })],
},
rpc: { stewardsSidebar: () => sidebarData({ bindings: [binding()] }) } as never,
});
// The effort row's own title anchor carries the full title.
const effortAnchor = (await waitFor(() => slot.getByText("Fix login"))).closest("a")!;
expect(effortAnchor.getAttribute("title")).toBe("ENG-1: Fix login");
// So does a plain thread row's title anchor.
fireEvent.click(slot.getByRole("button", { name: /Threads/u }));
const plainAnchor = (await waitFor(() => slot.getByText(plainTitle))).closest("a")!;
expect(plainAnchor.getAttribute("title")).toBe(plainTitle);
slot.lifecycle.unmount();
});

it("shortens a pull-request key to #N and spells out the kind", async () => {
const slot = await renderSidebar({
sidebarThreads: { projects, threads: [thread({ id: "thr_steward", displayTitle: "acme/web#612: Read dashboard metrics" })] },
Expand Down
Loading