From 39fb540844ecf44252e55714835f2689b294b5a7 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Tue, 30 Jun 2026 01:19:10 -0700 Subject: [PATCH] Improve styling and scannability of PR and task pages (#6870) - Update the PR state badge icon to dynamically match merged, closed, or draft states. - Simplify PR merge direction layout using branch tags and a directional arrow. - Add author avatars to the PR metadata row. - Prevent scrolled task rows from bleeding through sticky elements by adjusting header z-indexes and applying opaque hover/surface backgrounds. - Refine padding, text size, and spacing across the PR and task views. --- .../src/components/PullRequestPage.tsx | 90 ++++++++++++------- src/renderer/src/components/TaskPage.tsx | 38 ++++---- src/renderer/src/i18n/locales/en.json | 2 + src/renderer/src/i18n/locales/es.json | 4 +- src/renderer/src/i18n/locales/ja.json | 4 +- src/renderer/src/i18n/locales/ko.json | 4 +- src/renderer/src/i18n/locales/zh.json | 4 +- 7 files changed, 95 insertions(+), 51 deletions(-) diff --git a/src/renderer/src/components/PullRequestPage.tsx b/src/renderer/src/components/PullRequestPage.tsx index 4f7eb62f8..aa1a23707 100644 --- a/src/renderer/src/components/PullRequestPage.tsx +++ b/src/renderer/src/components/PullRequestPage.tsx @@ -15,6 +15,7 @@ import { useShallow } from 'zustand/react/shallow' import type { editor as monacoEditor } from 'monaco-editor' import { ArrowDown, + ArrowLeft, ArrowRight, ArrowUp, Braces, @@ -30,6 +31,7 @@ import { GitMerge, GitPullRequest, GitPullRequestClosed, + GitPullRequestDraft, ListChecks, LoaderCircle, MessageSquare, @@ -6759,7 +6761,18 @@ export default function PullRequestPage({ refetchTick ]) - const Icon = workItem?.type === 'pr' ? GitPullRequest : CircleDot + // Why: the state pill's icon must track the resolved state so a merged PR + // reads as merged (purple GitMerge) rather than wearing the open-PR glyph. + const Icon = + workItem?.type === 'pr' + ? localState === 'merged' + ? GitMerge + : localState === 'closed' + ? GitPullRequestClosed + : localState === 'draft' + ? GitPullRequestDraft + : GitPullRequest + : CircleDot const displayWorkItem = useMemo(() => { if (!workItem) { return null @@ -6984,15 +6997,15 @@ export default function PullRequestPage({ {backLabel} - · + · {ownerRepo ? ( <> {ownerRepo.owner} - / + / {ownerRepo.repo} - · + · ) : null} #{workItem.number} @@ -7046,11 +7059,13 @@ export default function PullRequestPage({ {/* Row 2: PR title block — large weight-400 title + state row, mirrors Primer pr-title-block */} -
+
-

+

{workItem.title} - #{workItem.number} + + #{workItem.number} +

{/* Why: Orca's signature affordance — keep this primary so it stands out @@ -7059,9 +7074,8 @@ export default function PullRequestPage({ @@ -7110,7 +7121,7 @@ export default function PullRequestPage({
-
+
{stateBadgeLabel} - + + {workItem.author ? ( + + ) : null} {workItem.author ?? translate('auto.components.PullRequestPage.77d9388fb0', 'unknown')} - - {translate('auto.components.PullRequestPage.b0e80f083d', 'wants to merge into')} - + + {/* Why: the scannable base ← head idiom reads faster than a prose + sentence and matches how reviewers think about merge direction. */} + {baseBranch ? ( - + {baseBranch} ) : ( @@ -7137,9 +7158,9 @@ export default function PullRequestPage({ {translate('auto.components.PullRequestPage.c44b70352b', 'base branch')} )} - {translate('auto.components.PullRequestPage.e1f3641bfd', 'from')} + {headBranch ? ( - + {headBranch} ) : ( @@ -7147,16 +7168,21 @@ export default function PullRequestPage({ {translate('auto.components.PullRequestPage.00b7b82329', 'head branch')} )} - - {translate('auto.components.PullRequestPage.e6996f4024', '· updated')} - {formatRelativeTime(workItem.updatedAt)} - + + · + + {translate('auto.components.PullRequestPage.dd5d9a4f17', 'updated {{value0}}', { + value0: formatRelativeTime(workItem.updatedAt) + })} {attachedWorkspaceLabel ? ( - - - {attachedWorkspaceLabel} - + <> + · + + + {attachedWorkspaceLabel} + + ) : null}
diff --git a/src/renderer/src/components/TaskPage.tsx b/src/renderer/src/components/TaskPage.tsx index df16663c4..944fd404f 100644 --- a/src/renderer/src/components/TaskPage.tsx +++ b/src/renderer/src/components/TaskPage.tsx @@ -466,9 +466,10 @@ function getTaskPageRepoCacheInput(repo: Repo): { } } -// Why: the row's px-3 left padding leaves a 12px gap between the scroll-viewport -// edge and the sticky ID column; without a covering ::before, scrolled cell text -// bleeds through that strip. Same trick as the title column for its 8px gap. +// Why: the sticky header's bg must be opaque (GITHUB_TASK_ROW_SURFACE_CLASS, not +// bg-muted/50) or vertically-scrolled rows bleed through it. These left-sticky +// cells additionally need a ::before gap-cover so horizontally-scrolled header +// columns don't show through the row's px-3 padding strip. const GITHUB_TASK_STICKY_ID_HEADER_CLASS = cn( 'sticky left-3 z-30 before:absolute before:-left-3 before:top-0 before:bottom-0 before:w-3 before:bg-inherit', GITHUB_TASK_ROW_SURFACE_CLASS @@ -7823,12 +7824,12 @@ export default function TaskPage(): React.JSX.Element { icon). Matching that here needs 6px top padding above the 32px cluster (6 + 16 = 22). The previous pt-3 placed the cluster 6px too low, breaking the visual band across the top chrome. */} -
+
-
-
+
+
-
+
{getGitHubTaskKindPresets(activeGithubTaskKind).map((option) => { const active = activeTaskPreset === option.id return ( @@ -8371,7 +8372,7 @@ export default function TaskPage(): React.JSX.Element {
) : taskSource === 'linear' && linearConnected ? (
@@ -8598,7 +8599,7 @@ export default function TaskPage(): React.JSX.Element { ) : null}
) : taskSource === 'jira' && jiraConnected ? ( -
+
{jiraPresets.map((preset) => { @@ -8806,7 +8807,7 @@ export default function TaskPage(): React.JSX.Element {
@@ -8935,8 +8936,12 @@ export default function TaskPage(): React.JSX.Element { style={{ scrollbarGutter: 'stable' }} >
@@ -9157,7 +9162,10 @@ export default function TaskPage(): React.JSX.Element { } }} className={cn( - 'group/github-task-row grid cursor-pointer gap-2 px-3 py-2 text-left transition hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50', + // Why: hover uses the same opaque muted-70% mix as the sticky + // ID/Title cells (GITHUB_TASK_ROW_HOVER_SURFACE_CLASS) so the + // left columns don't show a different shade than the rest of the row. + 'group/github-task-row grid cursor-pointer gap-2 px-3 py-2 text-left transition-colors hover:[background:color-mix(in_srgb,var(--muted)_70%,var(--background))] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50', githubTaskGridClass )} > @@ -9198,7 +9206,7 @@ export default function TaskPage(): React.JSX.Element { /> ) : null}
-
+
{item.author ?? translate( diff --git a/src/renderer/src/i18n/locales/en.json b/src/renderer/src/i18n/locales/en.json index 63f33efd0..5834e6da8 100644 --- a/src/renderer/src/i18n/locales/en.json +++ b/src/renderer/src/i18n/locales/en.json @@ -1172,6 +1172,8 @@ "94d95cf1f7": "Checks", "9e8d45700e": "Conversation", "e6996f4024": "· updated", + "dd5d9a4f17": "updated {{value0}}", + "71a3c0f9d2": "Start workspace", "00b7b82329": "head branch", "e1f3641bfd": "from", "c44b70352b": "base branch", diff --git a/src/renderer/src/i18n/locales/es.json b/src/renderer/src/i18n/locales/es.json index 44d9fc80f..7145c7683 100644 --- a/src/renderer/src/i18n/locales/es.json +++ b/src/renderer/src/i18n/locales/es.json @@ -1334,7 +1334,9 @@ "8ff5ae8866": "Responsables", "82c87eceb9": "Editar responsables", "1ff5d979df": "Nadie asignado", - "checkActionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked." + "checkActionRequiredHint": "Esta comprobación requiere una acción manual en GitHub (por ejemplo, aprobar la ejecución del flujo de trabajo) antes de poder desbloquear la fusión.", + "dd5d9a4f17": "actualizado {{value0}}", + "71a3c0f9d2": "Iniciar espacio de trabajo" }, "QuickOpen": { "1dbd3f59ff": "Mover", diff --git a/src/renderer/src/i18n/locales/ja.json b/src/renderer/src/i18n/locales/ja.json index c4bef5669..10b7477f9 100644 --- a/src/renderer/src/i18n/locales/ja.json +++ b/src/renderer/src/i18n/locales/ja.json @@ -1334,7 +1334,9 @@ "8ff5ae8866": "担当者", "82c87eceb9": "担当者を編集", "1ff5d979df": "担当者なし", - "checkActionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked." + "checkActionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked.", + "dd5d9a4f17": "{{value0}}に更新", + "71a3c0f9d2": "ワークスペースを開始" }, "QuickOpen": { "1dbd3f59ff": "移動", diff --git a/src/renderer/src/i18n/locales/ko.json b/src/renderer/src/i18n/locales/ko.json index c054decca..35174faff 100644 --- a/src/renderer/src/i18n/locales/ko.json +++ b/src/renderer/src/i18n/locales/ko.json @@ -1334,7 +1334,9 @@ "8ff5ae8866": "담당자", "82c87eceb9": "담당자 편집", "1ff5d979df": "할당된 사람이 없음", - "checkActionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked." + "checkActionRequiredHint": "이 검사는 병합 차단을 해제하기 전에 GitHub에서 수동 작업(예: 워크플로 실행 승인)이 필요합니다.", + "dd5d9a4f17": "{{value0}}에 업데이트됨", + "71a3c0f9d2": "워크스페이스 시작" }, "QuickOpen": { "1dbd3f59ff": "이동", diff --git a/src/renderer/src/i18n/locales/zh.json b/src/renderer/src/i18n/locales/zh.json index 13d169c17..7639f5985 100644 --- a/src/renderer/src/i18n/locales/zh.json +++ b/src/renderer/src/i18n/locales/zh.json @@ -1334,7 +1334,9 @@ "8ff5ae8866": "负责人", "82c87eceb9": "编辑负责人", "1ff5d979df": "未分配任何人", - "checkActionRequiredHint": "This check needs a manual action on GitHub (for example, approving the workflow run) before merging is unblocked." + "checkActionRequiredHint": "此检查需要在 GitHub 上执行手动操作(例如,批准工作流运行),然后才能解除合并阻止。", + "dd5d9a4f17": "{{value0}}更新", + "71a3c0f9d2": "启动工作区" }, "QuickOpen": { "1dbd3f59ff": "手机",