File tree Expand file tree Collapse file tree
src/features/dashboard/templates/tags Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export { TagDialogBuildRow } from './tag-dialog-build-row'
22export { TagDialogFooter , type TagDialogStage } from './tag-dialog-footer'
33export { TagDialogStageTransition } from './tag-dialog-stage-transition'
44export { TagDialogSuccess } from './tag-dialog-success'
5+ export { TagDialogTitle } from './tag-dialog-title'
Original file line number Diff line number Diff line change 22
33import { cn } from '@/lib/utils/ui'
44import { CheckIcon } from '@/ui/primitives/icons'
5+ import { MiddleTruncate } from '@/ui/primitives/middle-truncate'
56
67interface TagDialogSuccessProps {
78 tag : string
@@ -22,9 +23,15 @@ export function TagDialogSuccess({
2223 ) }
2324 >
2425 < CheckIcon className = "size-12 text-accent-positive-highlight" />
25- < p className = "prose-headline-small uppercase text-fg" >
26- < span className = "font-mono" > ‘{ tag } ’</ span >
27- < br />
26+ < p className = "prose-headline-small text-fg max-w-full uppercase" >
27+ < span
28+ className = "flex max-w-full items-baseline justify-center font-mono"
29+ title = { `‘${ tag } ’` }
30+ >
31+ < span className = "shrink-0" > ‘</ span >
32+ < MiddleTruncate tail = { 10 } text = { tag } className = "min-w-0" />
33+ < span className = "shrink-0" > ’</ span >
34+ </ span >
2835 { message }
2936 </ p >
3037 </ div >
Original file line number Diff line number Diff line change 1+ 'use client'
2+
3+ import { cn } from '@/lib/utils/ui'
4+ import { DialogTitle } from '@/ui/primitives/dialog'
5+ import { MiddleTruncate } from '@/ui/primitives/middle-truncate'
6+
7+ interface TagDialogTitleProps {
8+ prefix ?: string
9+ tag : string
10+ suffix ?: string
11+ className ?: string
12+ srOnly ?: boolean
13+ }
14+
15+ export function TagDialogTitle ( {
16+ prefix,
17+ tag,
18+ suffix,
19+ className,
20+ srOnly,
21+ } : TagDialogTitleProps ) {
22+ if ( srOnly ) {
23+ return (
24+ < DialogTitle className = "sr-only" >
25+ { prefix } ‘{ tag } ’{ suffix }
26+ </ DialogTitle >
27+ )
28+ }
29+
30+ return (
31+ < DialogTitle
32+ className = { cn ( 'flex min-w-0 items-baseline pr-6' , className ) }
33+ title = { `${ prefix ?? '' } ‘${ tag } ’${ suffix ?? '' } ` }
34+ >
35+ { prefix ? (
36+ < span className = "shrink-0 whitespace-pre" > { prefix } </ span >
37+ ) : null }
38+ < span className = "shrink-0" > ‘</ span >
39+ < MiddleTruncate text = { tag } className = "min-w-0 font-mono" />
40+ < span className = "shrink-0" > ’</ span >
41+ { suffix ? (
42+ < span className = "shrink-0 whitespace-pre" > { suffix } </ span >
43+ ) : null }
44+ </ DialogTitle >
45+ )
46+ }
Original file line number Diff line number Diff line change 66 DialogContent ,
77 DialogDescription ,
88 DialogHeader ,
9- DialogTitle ,
109} from '@/ui/primitives/dialog'
1110import { ArrowDivider } from './arrow-divider'
1211import BuildPicker , { type BuildSelectionSource } from './build-picker'
@@ -15,6 +14,7 @@ import {
1514 TagDialogFooter ,
1615 TagDialogStageTransition ,
1716 TagDialogSuccess ,
17+ TagDialogTitle ,
1818} from './components'
1919import { trackTagTableInteraction } from './table-config'
2020import { useTagAssignmentMutation } from './use-tag-assignment-mutation'
@@ -138,11 +138,11 @@ function ReassignTagDialogBody({
138138 return (
139139 < TagDialogStageTransition phase = { stage === 'success' ? 'success' : 'form' } >
140140 < DialogHeader >
141- < DialogTitle className = { stage === 'success' ? 'sr-only' : undefined } >
142- { stage === 'success'
143- ? `‘ ${ tag } ’ reassigned successfully`
144- : ` reassign ‘ $ {tag } ’` }
145- </ DialogTitle >
141+ { stage === 'success' ? (
142+ < TagDialogTitle srOnly tag = { tag } suffix = " reassigned successfully" />
143+ ) : (
144+ < TagDialogTitle prefix = " reassign " tag = { tag } />
145+ ) }
146146 < DialogDescription className = "sr-only" >
147147 { stage === 'success'
148148 ? `Tag ${ tag } reassigned.`
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ import {
66 DialogContent ,
77 DialogDescription ,
88 DialogHeader ,
9- DialogTitle ,
109} from '@/ui/primitives/dialog'
1110import { ArrowDivider } from './arrow-divider'
1211import {
1312 TagDialogBuildRow ,
1413 TagDialogFooter ,
1514 TagDialogStageTransition ,
1615 TagDialogSuccess ,
16+ TagDialogTitle ,
1717} from './components'
1818import { trackTagTableInteraction } from './table-config'
1919import { useTagAssignmentMutation } from './use-tag-assignment-mutation'
@@ -115,11 +115,16 @@ function RollbackTagDialogBody({
115115 return (
116116 < TagDialogStageTransition phase = { stage === 'success' ? 'success' : 'form' } >
117117 < DialogHeader >
118- < DialogTitle className = { stage === 'success' ? 'sr-only' : undefined } >
119- { stage === 'success'
120- ? `Rollback ‘${ tag } ’ succeeded`
121- : `Rollback ‘${ tag } ’` }
122- </ DialogTitle >
118+ { stage === 'success' ? (
119+ < TagDialogTitle
120+ srOnly
121+ prefix = "Rollback "
122+ tag = { tag }
123+ suffix = " succeeded"
124+ />
125+ ) : (
126+ < TagDialogTitle prefix = "Rollback " tag = { tag } />
127+ ) }
123128 < DialogDescription className = "sr-only" >
124129 { stage === 'success'
125130 ? `Tag ${ tag } rolled back to build ${ targetBuildId } .`
You can’t perform that action at this time.
0 commit comments