@@ -59,7 +59,7 @@ import { ADateTag } from "#/core/common/component/adate-tag";
5959import { compareADate } from "#/core/common/adate" ;
6060import { TimePlanTag } from "#/core/apps/time_plans/component/tag" ;
6161import { withTimePlanView } from "#/core/apps/time_plans/view-mode" ;
62- import { IsKeyTag } from "#/core/common /component/is-key-tag " ;
62+ import { useBigScreen } from "#/core/infra /component/use-big-screen " ;
6363
6464interface TimePlanActivityCardProps {
6565 topLevelInfo : TopLevelInfo ;
@@ -93,6 +93,7 @@ interface TimePlanActivityCardProps {
9393}
9494
9595export function TimePlanActivityCard ( props : TimePlanActivityCardProps ) {
96+ const isBigScreen = useBigScreen ( ) ;
9697 const associatedInboxTaskActivities =
9798 props . associatedInboxTaskActivities ?? [ ] ;
9899 const placeActivity =
@@ -148,7 +149,16 @@ export function TimePlanActivityCard(props: TimePlanActivityCardProps) {
148149 paddingLeft : showTargetTypeChip ? "1.75rem" : "0.5rem" ,
149150 gap : "0.25rem" ,
150151 }
151- : { } ) ,
152+ : ! isBigScreen
153+ ? {
154+ // A tenth of the 16px the link normally uses on each side,
155+ // so the name gets the width back on a phone. The vertical
156+ // padding stays put and keeps the name clear of the corner
157+ // chip.
158+ paddingLeft : "1.6px" ,
159+ paddingRight : "1.6px" ,
160+ }
161+ : { } ) ,
152162 } ,
153163 } }
154164 >
@@ -223,7 +233,6 @@ function TimePlanActivityCardBody(props: TimePlanActivityCardProps) {
223233 singleLine
224234 >
225235 < ActivityCardName
226- isKey = { inboxTask ?. is_key ?? false }
227236 compact = { props . compact }
228237 fontWeight = {
229238 inboxTask
@@ -318,7 +327,6 @@ function TimePlanActivityCardBody(props: TimePlanActivityCardProps) {
318327 singleLine
319328 >
320329 < ActivityCardName
321- isKey = { ownedInboxTask ?. is_key ?? false }
322330 compact = { props . compact }
323331 fontWeight = {
324332 todoTask
@@ -412,7 +420,6 @@ function TimePlanActivityCardBody(props: TimePlanActivityCardProps) {
412420 expanded = { props . expanded }
413421 >
414422 < ActivityCardName
415- isKey = { habit ?. is_key ?? false }
416423 compact = { props . compact }
417424 fontWeight = {
418425 habit
@@ -512,7 +519,6 @@ function TimePlanActivityCardBody(props: TimePlanActivityCardProps) {
512519 expanded = { props . expanded }
513520 >
514521 < ActivityCardName
515- isKey = { ownedInboxTask ?. is_key ?? false }
516522 compact = { props . compact }
517523 fontWeight = {
518524 chore
@@ -616,7 +622,6 @@ function TimePlanActivityCardBody(props: TimePlanActivityCardProps) {
616622 singleLine
617623 >
618624 < ActivityCardName
619- isKey = { bigPlan ?. is_key ?? false }
620625 compact = { props . compact }
621626 fontWeight = {
622627 bigPlan
@@ -726,11 +731,15 @@ function HabitChoreTaskStatsView(props: {
726731 inboxTasksByRefId : Map < string , InboxTask > ;
727732 compact ?: boolean ;
728733} ) {
734+ const isBigScreen = useBigScreen ( ) ;
729735 const stats = habitChoreInboxTaskStats (
730736 props . activities ,
731737 props . inboxTasksByRefId ,
732738 ) ;
733739 const label = `${ stats . notStartedCount } not started, ${ stats . doneCount } done, ${ stats . notDoneCount } not done` ;
740+ // Only the wide list view has room to spell the counts out. The calendar
741+ // column and the phone show icons, so the name keeps the space instead.
742+ const asIcons = props . compact || ! isBigScreen ;
734743
735744 return (
736745 < Typography
@@ -741,10 +750,10 @@ function HabitChoreTaskStatsView(props: {
741750 sx = { {
742751 flexShrink : 0 ,
743752 whiteSpace : "nowrap" ,
744- ...( props . compact ? { fontSize : "0.65rem" } : { } ) ,
753+ ...( asIcons ? { fontSize : "0.65rem" } : { } ) ,
745754 } }
746755 >
747- { props . compact
756+ { asIcons
748757 ? `📥${ stats . notStartedCount } ✅${ stats . doneCount } ⛔${ stats . notDoneCount } `
749758 : `${ stats . notStartedCount } not started · ${ stats . doneCount } done · ${ stats . notDoneCount } not done` }
750759 </ Typography >
@@ -766,39 +775,32 @@ function TimePlanActivityDueDateTag(props: {
766775 return < ADateTag label = "Due At" date = { props . dueDate } /> ;
767776}
768777
769- // Key chip and name stay on one line so the 🔑 never sits alone after a wrap.
770778// The name ellipsizes so status icons and chips can keep their place beside it.
771779function ActivityCardName ( props : {
772- isKey : boolean ;
773780 compact ?: boolean ;
774781 fontWeight : "bold" | "normal" | "lighter" ;
775782 children : ReactNode ;
776783} ) {
784+ const isBigScreen = useBigScreen ( ) ;
785+
777786 return (
778- < Box
787+ < Typography
788+ component = "span"
789+ noWrap
779790 sx = { {
780- display : "flex" ,
781- flexWrap : "nowrap" ,
782- alignItems : "center" ,
783- gap : props . compact ? "0.25rem" : "0.5rem" ,
791+ fontWeight : props . fontWeight ,
784792 minWidth : 0 ,
785793 flex : "0 1 auto" ,
786794 overflow : "hidden" ,
795+ textOverflow : "ellipsis" ,
796+ ...( props . compact
797+ ? { fontSize : "0.75rem" , lineHeight : 1.25 }
798+ : ! isBigScreen
799+ ? { fontSize : "0.85rem" , lineHeight : 1.3 }
800+ : { } ) ,
787801 } }
788802 >
789- < IsKeyTag isKey = { props . isKey } />
790- < Typography
791- noWrap
792- sx = { {
793- fontWeight : props . fontWeight ,
794- minWidth : 0 ,
795- overflow : "hidden" ,
796- textOverflow : "ellipsis" ,
797- ...( props . compact ? { fontSize : "0.75rem" , lineHeight : 1.25 } : { } ) ,
798- } }
799- >
800- { props . children }
801- </ Typography >
802- </ Box >
803+ { props . children }
804+ </ Typography >
803805 ) ;
804806}
0 commit comments