@@ -152,9 +152,7 @@ function EntityCheckboxGrid({ selected, onChange }: EntityCheckboxGridProps) {
152152 < div className = 'flex flex-col gap-3' >
153153 { groups . map ( ( group ) => (
154154 < div key = { group . label } className = 'flex flex-col gap-1.5' >
155- < span className = 'font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide' >
156- { group . label }
157- </ span >
155+ < span className = 'font-medium text-[var(--text-muted)] text-small' > { group . label } </ span >
158156 < div className = 'grid grid-cols-2 gap-x-2 gap-y-0.5' >
159157 { group . entities . map ( ( entity ) => {
160158 const checkboxId = `pii-${ entity . value } `
@@ -388,10 +386,10 @@ export function DataRetentionSettings() {
388386 async function removeRule ( id : string ) {
389387 try {
390388 await persistRules ( rules . filter ( ( r ) => r . id !== id ) )
391- toast . success ( 'Workspace override removed .' )
389+ toast . success ( 'PII redaction updated .' )
392390 } catch ( error ) {
393391 const msg = toError ( error ) . message
394- logger . error ( 'Failed to remove workspace override ' , { error : msg } )
392+ logger . error ( 'Failed to update PII redaction ' , { error : msg } )
395393 toast . error ( msg )
396394 }
397395 }
@@ -494,70 +492,84 @@ export function DataRetentionSettings() {
494492 < SettingsSection label = 'PII Redaction' >
495493 < div className = 'flex flex-col gap-6' >
496494 < div className = 'flex flex-col gap-2' >
497- < span className = 'font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide' >
498- Default · all workspaces
499- </ span >
500- < div className = 'flex items-center justify-between gap-3 rounded-lg border border-[var(--border-1)] px-3 py-2' >
501- < span className = 'truncate text-[var(--text-body)] text-small' >
502- { entitySummary ( defaultRule ?. entityTypes ?? [ ] ) }
495+ < div className = 'flex items-center justify-between gap-3' >
496+ < span className = 'font-medium text-[var(--text-muted)] text-small' >
497+ Default · all workspaces
503498 </ span >
504- < Chip onClick = { openEditDefault } > Edit</ Chip >
499+ { ! defaultRule && (
500+ < Chip leftIcon = { Plus } onClick = { openEditDefault } >
501+ Add redaction
502+ </ Chip >
503+ ) }
505504 </ div >
506- </ div >
507- < div className = 'flex flex-col gap-2' >
508- < div className = 'flex items-center justify-between gap-3' >
509- < div className = 'flex flex-col' >
510- < span className = 'font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide' >
511- Workspace overrides
505+ { defaultRule && (
506+ < div className = 'flex items-center justify-between gap-3 rounded-lg border border-[var(--border-1)] px-3 py-2' >
507+ < span className = 'truncate text-[var(--text-body)] text-small' >
508+ { entitySummary ( defaultRule . entityTypes ) }
512509 </ span >
513- < span className = 'text-[var(--text-muted)] text-caption' >
514- An override replaces the default for that workspace.
515- </ span >
516- </ div >
517- < Chip
518- leftIcon = { Plus }
519- onClick = { openAddOverride }
520- disabled = { freeWorkspaces . length === 0 }
521- >
522- Add override
523- </ Chip >
524- </ div >
525- { overrideRules . length === 0 ? (
526- < p className = 'text-[var(--text-muted)] text-caption' >
527- No overrides — every workspace uses the default.
528- </ p >
529- ) : (
530- < div className = 'flex flex-col gap-2' >
531- { overrideRules . map ( ( rule ) => (
532- < div
533- key = { rule . id }
534- className = 'flex items-center justify-between gap-3 rounded-lg border border-[var(--border-1)] px-3 py-2'
510+ < div className = 'flex flex-shrink-0 items-center gap-2' >
511+ < Chip onClick = { openEditDefault } > Edit</ Chip >
512+ < Chip
513+ onClick = { ( ) => removeRule ( defaultRule . id ) }
514+ disabled = { updateMutation . isPending }
535515 >
536- < div className = 'flex min-w-0 flex-col' >
537- < span className = 'truncate text-[var(--text-body)] text-small' >
538- { workspaceName ( rule . workspaceId as string ) }
539- </ span >
540- < span className = 'truncate text-[var(--text-muted)] text-caption' >
541- { entitySummary ( rule . entityTypes ) }
542- </ span >
543- </ div >
544- < div className = 'flex flex-shrink-0 items-center gap-2' >
545- < Chip onClick = { ( ) => openEditOverride ( rule ) } > Edit</ Chip >
546- < Chip
547- onClick = { ( ) => removeRule ( rule . id ) }
548- disabled = { updateMutation . isPending }
549- >
550- Remove
551- </ Chip >
552- </ div >
553- </ div >
554- ) ) }
555- < span className = 'text-[var(--text-muted)] text-caption' >
556- Workspaces not listed use the default.
557- </ span >
516+ Delete
517+ </ Chip >
518+ </ div >
558519 </ div >
559520 ) }
560521 </ div >
522+ { defaultRule && (
523+ < div className = 'flex flex-col gap-2' >
524+ < div className = 'flex items-center justify-between gap-3' >
525+ < span className = 'font-medium text-[var(--text-muted)] text-small' >
526+ Workspace overrides
527+ </ span >
528+ < Chip
529+ leftIcon = { Plus }
530+ onClick = { openAddOverride }
531+ disabled = { freeWorkspaces . length === 0 }
532+ >
533+ Add override
534+ </ Chip >
535+ </ div >
536+ { overrideRules . length === 0 ? (
537+ < p className = 'text-[var(--text-muted)] text-caption' >
538+ No overrides — every workspace uses the default.
539+ </ p >
540+ ) : (
541+ < div className = 'flex flex-col gap-2' >
542+ { overrideRules . map ( ( rule ) => (
543+ < div
544+ key = { rule . id }
545+ className = 'flex items-center justify-between gap-3 rounded-lg border border-[var(--border-1)] px-3 py-2'
546+ >
547+ < div className = 'flex min-w-0 flex-col' >
548+ < span className = 'truncate text-[var(--text-body)] text-small' >
549+ { workspaceName ( rule . workspaceId as string ) }
550+ </ span >
551+ < span className = 'truncate text-[var(--text-muted)] text-caption' >
552+ { entitySummary ( rule . entityTypes ) }
553+ </ span >
554+ </ div >
555+ < div className = 'flex flex-shrink-0 items-center gap-2' >
556+ < Chip onClick = { ( ) => openEditOverride ( rule ) } > Edit</ Chip >
557+ < Chip
558+ onClick = { ( ) => removeRule ( rule . id ) }
559+ disabled = { updateMutation . isPending }
560+ >
561+ Delete
562+ </ Chip >
563+ </ div >
564+ </ div >
565+ ) ) }
566+ < span className = 'text-[var(--text-muted)] text-caption' >
567+ Workspaces not listed use the default.
568+ </ span >
569+ </ div >
570+ ) }
571+ </ div >
572+ ) }
561573 </ div >
562574 </ SettingsSection >
563575 </ div >
0 commit comments