mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-19 04:00:38 +09:00
feat: show sub-task count in title when parent is collapsed
When a parent issue is collapsed, its title is suffixed with "(N sub-tasks)" so the count remains visible at a glance. The suffix disappears when the parent is expanded. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
11643941e6
commit
12011fa9de
2 changed files with 8 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ interface IssueRowProps {
|
||||||
mobileMeta?: ReactNode;
|
mobileMeta?: ReactNode;
|
||||||
desktopTrailing?: ReactNode;
|
desktopTrailing?: ReactNode;
|
||||||
trailingMeta?: ReactNode;
|
trailingMeta?: ReactNode;
|
||||||
|
titleSuffix?: ReactNode;
|
||||||
unreadState?: UnreadState | null;
|
unreadState?: UnreadState | null;
|
||||||
onMarkRead?: () => void;
|
onMarkRead?: () => void;
|
||||||
onArchive?: () => void;
|
onArchive?: () => void;
|
||||||
|
|
@ -35,6 +36,7 @@ export function IssueRow({
|
||||||
mobileMeta,
|
mobileMeta,
|
||||||
desktopTrailing,
|
desktopTrailing,
|
||||||
trailingMeta,
|
trailingMeta,
|
||||||
|
titleSuffix,
|
||||||
unreadState = null,
|
unreadState = null,
|
||||||
onMarkRead,
|
onMarkRead,
|
||||||
onArchive,
|
onArchive,
|
||||||
|
|
@ -63,7 +65,7 @@ export function IssueRow({
|
||||||
</span>
|
</span>
|
||||||
<span className="flex min-w-0 flex-1 flex-col gap-1 sm:contents">
|
<span className="flex min-w-0 flex-1 flex-col gap-1 sm:contents">
|
||||||
<span className="line-clamp-2 text-sm sm:order-2 sm:min-w-0 sm:flex-1 sm:truncate sm:line-clamp-none">
|
<span className="line-clamp-2 text-sm sm:order-2 sm:min-w-0 sm:flex-1 sm:truncate sm:line-clamp-none">
|
||||||
{issue.title}
|
{issue.title}{titleSuffix}
|
||||||
</span>
|
</span>
|
||||||
<span className="flex items-center gap-2 sm:order-1 sm:shrink-0">
|
<span className="flex items-center gap-2 sm:order-1 sm:shrink-0">
|
||||||
{desktopLeadingSpacer ? (
|
{desktopLeadingSpacer ? (
|
||||||
|
|
|
||||||
|
|
@ -697,6 +697,11 @@ export function IssuesList({
|
||||||
issue={issue}
|
issue={issue}
|
||||||
issueLinkState={issueLinkState}
|
issueLinkState={issueLinkState}
|
||||||
className={isChild ? "pl-6 sm:pl-7" : undefined}
|
className={isChild ? "pl-6 sm:pl-7" : undefined}
|
||||||
|
titleSuffix={hasChildren && !isExpanded ? (
|
||||||
|
<span className="ml-1.5 text-xs text-muted-foreground">
|
||||||
|
({children.length} sub-task{children.length !== 1 ? "s" : ""})
|
||||||
|
</span>
|
||||||
|
) : undefined}
|
||||||
mobileLeading={
|
mobileLeading={
|
||||||
hasChildren ? (
|
hasChildren ? (
|
||||||
<button type="button" onClick={toggleCollapse}>
|
<button type="button" onClick={toggleCollapse}>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue