Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(issues): tighten the mobile issue-detail gutters to 12px (MUL-5787) (#6465)

Jiayuan Zhang8c39b986253b
diff --git a/packages/views/issues/components/issue-detail.test.tsx b/packages/views/issues/components/issue-detail.test.tsx
index 75acc135a9..7a9a364059 100644
--- a/packages/views/issues/components/issue-detail.test.tsx
+++ b/packages/views/issues/components/issue-detail.test.tsx
@@ -666,6 +666,38 @@ describe("IssueDetail (shared)", () => {
).toBe(true);
});
+ it("gives the skeleton the same horizontal gutters as the loaded column", async () => {
+ // The skeleton is the loaded column's stand-in, so a gutter change has to
+ // land on both or the column jumps sideways at the moment the issue
+ // arrives. Horizontal only: the loaded column also reserves the chat
+ // launcher's corner at its bottom, which the skeleton has no scroll to
+ // reach.
+ const horizontalGutters = (el: Element | null) =>
+ (el?.className ?? "")
+ .split(/\s+/)
+ .filter((cls) => /(^|:)px-/.test(cls))
+ .sort();
+
+ mockApiObj.getIssue.mockReturnValue(new Promise(() => {}));
+ const loadingRender = renderIssueDetail();
+ const skeletonGutters = horizontalGutters(
+ loadingRender.container.querySelector(".max-w-4xl"),
+ );
+ loadingRender.unmount();
+
+ mockApiObj.getIssue.mockResolvedValue(mockIssue);
+ const { container } = renderIssueDetail();
+ await waitFor(() => {
+ expect(screen.getByText("Implement authentication")).toBeInTheDocument();
+ });
+
+ // Non-empty guard: without it a renamed column class passes vacuously.
+ expect(skeletonGutters.length).toBeGreaterThan(0);
+ expect(skeletonGutters).toEqual(
+ horizontalGutters(container.querySelector(".max-w-4xl")),
+ );
+ });
+
it("renders comment bodies without Base UI collapsible panels", async () => {
const { container } = renderIssueDetail();
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index 0b95d14735..a124b932b5 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -1003,7 +1003,7 @@ export function IssueDetailSkeleton({ leading }: { leading?: ReactNode } = {}) {
<div className="flex-1 overflow-y-auto [scrollbar-gutter:stable_both-edges]">
{/* Gutters match the loaded column exactly (see its comment), so the
skeleton doesn't reflow sideways when real content mounts. */}
- <div className="mx-auto w-full max-w-4xl px-4 py-6 space-y-6 md:px-8 md:py-8">
+ <div className="mx-auto w-full max-w-4xl px-3 py-6 space-y-6 md:px-8 md:py-8">
<Skeleton className="h-8 w-3/4" />
<div className="space-y-2">
<Skeleton className="h-4 w-full" />
@@ -2528,12 +2528,12 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
className="relative flex-1 overflow-y-auto [scrollbar-gutter:stable_both-edges]"
>
{/* Gutters: 32px is a comfortable reading margin on a desktop column
- but eats 16% of a 393px phone, so below `md` they drop to 16px.
+ but eats 16% of a 393px phone, so below `md` they drop to 12px.
`max-md:pb-chat-launcher` reserves the launcher's corner at the end
of the scroll: below `md` the composer is not pinned (see
`useStickyComposer`), so it lands here — right where the launcher
floats — once the reader scrolls to the bottom. */}
- <div className="mx-auto w-full max-w-4xl px-4 py-6 max-md:pb-chat-launcher md:px-8 md:py-8">
+ <div className="mx-auto w-full max-w-4xl px-3 py-6 max-md:pb-chat-launcher md:px-8 md:py-8">
{titleLazy.active && (
<div className={titleLazy.ready ? undefined : "hidden"}>
<TitleEditor