Showing the changes to apps (3 of 3 files). Show all
Unified · Split
| @@ -272,7 +272,7 @@ function ArchivedThreadRow(props: { · 271 unmodified lines | |||
| 272 | </Text> | 272 | </Text> |
| 273 | <Text | 273 | <Text |
| 274 | className="text-xs text-foreground-tertiary" | 274 | className="text-xs text-foreground-tertiary" |
| 275 | style={{ fontVariant: ["tabular-nums"] }} | 275 | style={{ fontVariant: ["tabular-nums"], minWidth: 30, textAlign: "right" }} |
| 276 | > | 276 | > |
| 277 | {timestamp} | 277 | {timestamp} |
| 278 | </Text> | 278 | </Text> |
| @@ -370,7 +370,7 @@ function ThreadRow(props: { · 369 unmodified lines | |||
| 370 | </View> | 370 | </View> |
| 371 | <Text | 371 | <Text |
| 372 | className="text-xs text-foreground-tertiary" | 372 | className="text-xs text-foreground-tertiary" |
| 373 | style={{ fontVariant: ["tabular-nums"] }} | 373 | style={{ fontVariant: ["tabular-nums"], minWidth: 30, textAlign: "right" }} |
| 374 | > | 374 | > |
| 375 | {timestamp} | 375 | {timestamp} |
| 376 | </Text> | 376 | </Text> |
| @@ -1,12 +1,13 @@ | |||
| 1 | export function relativeTime(input: string): string { | 1 | export function relativeTime(input: string): string { |
| 2 | const timestamp = Date.parse(input); | 2 | const timestamp = Date.parse(input); |
| 3 | if (Number.isNaN(timestamp)) { | 3 | if (Number.isNaN(timestamp)) { |
| 4 | return "now"; | 4 | return "<1m"; |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | // Anything under a minute renders as "<1m" rather than a live seconds count. | ||
| 8 | // The seconds ticker changed width every second and reflowed the surrounding row. | ||
| 7 | const deltaSeconds = Math.max(0, Math.floor((Date.now() - timestamp) / 1000)); | 9 | const deltaSeconds = Math.max(0, Math.floor((Date.now() - timestamp) / 1000)); |
| 8 | if (deltaSeconds < 10) return "now"; | 10 | if (deltaSeconds < 60) return "<1m"; |
| 9 | if (deltaSeconds < 60) return `${deltaSeconds}s`; | ||
| 10 | 11 | ||
| 11 | const deltaMinutes = Math.floor(deltaSeconds / 60); | 12 | const deltaMinutes = Math.floor(deltaSeconds / 60); |
| 12 | if (deltaMinutes < 60) return `${deltaMinutes}m`; | 13 | if (deltaMinutes < 60) return `${deltaMinutes}m`; |