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
Expand Up @@ -130,7 +130,7 @@ export function CloudWorkspaceRecordView({
onSetVisibility={onSetVisibility}
/>
}
sideHeader={
sideActions={
<CloudWorkspaceRecordActions
archivedAt={workspace.deletedAt}
onOpenWorkspace={onOpenWorkspace}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import type { ReactNode } from "react";

interface CloudSectionProps {
title: ReactNode;
titleClassName?: string;
/** Lists past four rows scroll instead of growing the card. */
scrollable?: boolean;
children: ReactNode;
}

export function CloudSection({
title,
titleClassName,
scrollable = false,
children,
}: CloudSectionProps) {
return (
<div className="space-y-1">
<div className="px-2 text-[10px] font-medium tracking-wide text-muted-foreground uppercase">
<div
className={cn(
"px-2 text-[10px] font-medium tracking-wide text-muted-foreground uppercase",
titleClassName,
)}
>
{title}
</div>
<div className={cn(scrollable && "max-h-28 overflow-y-auto")}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export function DashboardSidebarHeader({
to: "/v2-workspace/$workspaceId",
fuzzy: true,
});
const onV2WorkspaceRoute = v2WorkspaceMatch !== false;
const showsAppTopBar = useShowsAppTopBar();
// Pre-select the viewed workspace's project in the new-workspace modal.
const { workspaces: hostWorkspaces } = useHostWorkspaces();
Expand Down Expand Up @@ -296,19 +295,14 @@ export function DashboardSidebarHeader({
return (
<div className="flex flex-col">
{/* The page's header row continues across the rail, and the macOS
window buttons sit in it. On the v2 workspace route that row is
the pane tab bar. */}
window buttons sit in it. */}
{!showsAppTopBar && (
<div
// w +1px: overlaps the container's border-r so the sidebar's
// vertical border starts below the row, not inside it. The tab
// bar fill is its bg-muted/45|35-over-background flattened to an
// opaque color so it can paint over that border pixel.
// vertical border starts below the row, not inside it.
className={cn(
"drag w-[calc(100%+1px)] shrink-0",
onV2WorkspaceRoute
? "h-10 bg-[color-mix(in_oklab,var(--muted)_45%,var(--background))] dark:bg-[color-mix(in_oklab,var(--muted)_35%,var(--background))]"
: cn("h-12", WINDOW_CHROME_BAND_CLASS),
"drag h-12 w-[calc(100%+1px)] shrink-0",
WINDOW_CHROME_BAND_CLASS,
)}
>
{!isMac && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface PageHeaderProps {
contentClassName?: string;
/** A row that lays out its own drag area, in place of `start` and `end`. */
children?: ReactNode;
/** False for a header with another header to its right, which keeps the Windows/Linux window controls clear instead. */
reservesWindowControls?: boolean;
}

/** Every screen's header row. The space between `start` and `end` drags the window. */
Expand All @@ -25,6 +27,7 @@ export function PageHeader({
className,
contentClassName,
children,
reservesWindowControls = true,
}: PageHeaderProps) {
const isBanded = useCollapsedSidebarBand();
return (
Expand All @@ -49,7 +52,7 @@ export function PageHeader({
{end}
</>
)}
<WindowControlsInset />
{reservesWindowControls && <WindowControlsInset />}
</div>
</header>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,55 @@
import { cn } from "@superset/ui/utils";
import type { ReactNode } from "react";
import { PageHeader } from "../PageHeader";
import { WindowChromeScope } from "../WindowChromeScope";

interface RecordLayoutProps {
header: ReactNode;
headerEnd?: ReactNode;
/** Narrow windows keep it on the main header's row. Without one, the side column runs to the top. */
sideHeader?: ReactNode;
/** The side column's heading, when its first section is named. */
sideTitle?: ReactNode;
/** Narrow windows keep them on the main header's row. */
sideActions?: ReactNode;
side: ReactNode;
children: ReactNode;
}

export function RecordLayout({
header,
headerEnd,
sideHeader,
sideTitle,
sideActions,
side,
children,
}: RecordLayoutProps) {
const hasSideHeader = sideHeader !== undefined;
return (
<div className="@container flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden">
<div
className={cn(
"grid min-h-0 flex-1 grid-cols-[minmax(0,1fr)_auto] content-start overflow-auto @min-[900px]:grid-cols-[minmax(0,1fr)_372px] @min-[900px]:grid-rows-[auto_minmax(0,1fr)] @min-[900px]:content-stretch @min-[900px]:overflow-hidden",
hasSideHeader
? "[grid-template-areas:'header_side-header'_'main_main'_'side_side'] @min-[900px]:[grid-template-areas:'header_side-header'_'main_side']"
: "[grid-template-areas:'header_header'_'main_main'_'side_side'] @min-[900px]:[grid-template-areas:'header_side'_'main_side']",
)}
>
<div className="grid min-h-0 flex-1 grid-cols-[minmax(0,1fr)_auto] content-start overflow-auto [grid-template-areas:'header_side-header'_'main_main'_'side_side'] @min-[900px]:grid-cols-[minmax(0,1fr)_372px] @min-[900px]:grid-rows-[auto_minmax(0,1fr)] @min-[900px]:content-stretch @min-[900px]:overflow-hidden @min-[900px]:[grid-template-areas:'header_side-header'_'main_side']">
<PageHeader
start={header}
end={headerEnd}
reservesWindowControls={false}
className="sticky top-0 z-10 min-w-0 bg-background text-[13px] [grid-area:header]"
/>
{hasSideHeader && (
<WindowChromeScope enabled={false}>
<PageHeader
className="sticky top-0 z-10 min-w-0 bg-background [grid-area:side-header] @min-[900px]:border-l @min-[900px]:border-border"
contentClassName="pl-0"
>
<div className="@container/record-actions flex h-full min-w-0 flex-1 items-center justify-end gap-3">
<div className="drag h-full min-w-0 flex-1" />
{sideHeader}
</div>
</PageHeader>
</WindowChromeScope>
)}
<WindowChromeScope enabled={false}>
<PageHeader
className="sticky top-0 z-10 min-w-0 bg-background [grid-area:side-header] @min-[900px]:border-l @min-[900px]:border-border"
contentClassName={sideTitle ? "pl-5" : "pl-0"}
Comment on lines +33 to +36

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Empty header reduces title space On a narrow Windows or Linux project page, the new side header has no visible title or actions, but its PageHeader still reserves space for the window controls. The main header reserves that space too, so the project name truncates sooner than it did when the header spanned the full row.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/RecordLayout/RecordLayout.tsx
Line: 32-35

Comment:
**Empty header reduces title space** On a narrow Windows or Linux project page, the new side header has no visible title or actions, but its `PageHeader` still reserves space for the window controls. The main header reserves that space too, so the project name truncates sooner than it did when the header spanned the full row.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

>
{sideTitle && (
<span className="hidden shrink-0 text-[10px] font-medium tracking-wide text-muted-foreground uppercase @min-[900px]:inline">
{sideTitle}
</span>
)}
<div className="@container/record-actions flex h-full min-w-0 flex-1 items-center justify-end gap-3">
<div className="drag h-full min-w-0 flex-1" />
{sideActions}
</div>
</PageHeader>
</WindowChromeScope>
<main className="min-w-0 pt-5 pr-10 pb-10 pl-8 [grid-area:main] @min-[900px]:overflow-auto">
{children}
</main>
<div className="relative min-w-0 border-t border-border [grid-area:side] @min-[900px]:overflow-auto @min-[900px]:border-t-0 @min-[900px]:border-l">
{!hasSideHeader && (
<div className="drag absolute inset-x-0 top-0 hidden h-9 @min-[900px]:block" />
)}
<div className="min-w-0 border-t border-border [grid-area:side] @min-[900px]:overflow-auto @min-[900px]:border-t-0 @min-[900px]:border-l">
{side}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function PageDetailView({ slug }: PageDetailViewProps) {
>
<PageTitleBar
className="h-full min-w-0 flex-1 border-b-0 px-0"
fillerClassName="drag"
page={page}
versions={versions}
currentUserId={currentUserId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function ProjectRecordView({
onBack={onBack}
/>
}
sideTitle={<Trans>Properties</Trans>}
side={
<ProjectRecordSide
project={project}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export function ProjectRecordSide({
});

return (
<aside className="space-y-4 px-3 py-[18px] text-[13px]">
<CloudSection title={<Trans>Properties</Trans>}>
<aside className="space-y-4 px-3 py-[18px] text-[13px] @min-[900px]:pt-1">
<CloudSection
title={<Trans>Properties</Trans>}
titleClassName="@min-[900px]:hidden"
>
<PropertyRow label={<Trans>Status</Trans>}>
<ProjectStatePicker
value={project.state}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ProjectFilter } from "renderer/routes/_authenticated/_dashboard/compone
import { WorkItemsSearch } from "renderer/routes/_authenticated/_dashboard/components/WorkItemsSearch";
import type { ProjectQueryTarget } from "renderer/routes/_authenticated/_dashboard/hooks/useProjectQueryTargets";
import { PullRequestDetailToggle } from "renderer/routes/_authenticated/_dashboard/pull-requests/components/PullRequestDetailToggle";
import { usePullRequestsSplitViewStore } from "renderer/routes/_authenticated/_dashboard/pull-requests/stores/pullRequestsSplitViewStore";
import type { PullRequestReviewFilter } from "renderer/routes/_authenticated/_dashboard/pull-requests/utils/pullRequestReviewFilter";
import { AuthorFilter } from "./components/AuthorFilter";
import { ReviewFilter } from "./components/ReviewFilter";
Expand Down Expand Up @@ -42,6 +43,9 @@ export function PullRequestsTopBar({
onStateFilterChange,
}: PullRequestsTopBarProps) {
const { t } = useLingui();
const isDetailCollapsed = usePullRequestsSplitViewStore(
(state) => state.isDetailCollapsed,
);
const stateTabs: ReadonlyArray<{
value: PullRequestsStateFilter;
label: string;
Expand Down Expand Up @@ -109,6 +113,7 @@ export function PullRequestsTopBar({
</div>
}
end={<PullRequestDetailToggle />}
reservesWindowControls={isDetailCollapsed}
/>
<div className="flex items-center gap-1.5">
<div className="min-w-0 flex-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function TaskRecordView({
return (
<RecordLayout
header={<TaskRecordTopBar slug={task.slug} onBack={onBack} />}
sideHeader={
sideActions={
<TaskRecordActions
task={task}
onCopyLink={onCopyLink}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function PRActionHeader({
pagesMenu,
}: PRActionHeaderProps) {
return (
<div className="@container/strip flex h-10 shrink-0 items-center bg-muted/45 px-2 dark:bg-muted/35">
<div className="@container/strip flex h-12 shrink-0 items-center bg-muted/45 px-2 dark:bg-muted/35">
<div className="@container drag flex h-full min-w-0 flex-1 items-center overflow-hidden pr-1">
<div className="no-drag flex h-6 min-w-0 flex-wrap items-center gap-x-1 overflow-hidden">
{shipControls}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function TabBar<TData>({
// children out with `no-drag` loses the carve-outs once they sit inside
// the masked/scrollable OverflowFadeContainer, which made the entire bar
// swallow clicks.
className="group/root-tabs flex h-10 min-w-0 shrink-0 items-stretch bg-muted/45 shadow-[inset_0_-1px_0_var(--border)] dark:bg-muted/35"
className="group/root-tabs flex h-12 min-w-0 shrink-0 items-stretch bg-muted/45 shadow-[inset_0_-1px_0_var(--border)] dark:bg-muted/35"
>
{renderTabBarLeading && (
<div className="flex h-full shrink-0 items-stretch border-b border-border">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface PageHeaderProps extends PageHeaderActions {
leading?: ReactNode;
trailing?: ReactNode;
className?: string;
/** The empty space between the title and the actions, e.g. a window-drag region. */
fillerClassName?: string;
}

export function PageHeader({
Expand All @@ -29,6 +31,7 @@ export function PageHeader({
leading,
trailing,
className,
fillerClassName,
onSetVisibility,
onSetSharedVersion,
onDelete,
Expand Down Expand Up @@ -81,7 +84,7 @@ export function PageHeader({
) : null}
</div>

<div className="drag h-full min-w-0 flex-1" />
<div className={cn("h-full min-w-0 flex-1", fillerClassName)} />
<div className="flex shrink-0 items-center gap-1">
{trailing}
<PageShareButton
Expand Down
Loading