Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(sidebar-v2): thread snoozing #4311

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 15 commits intomain fromrefs/pull/4311/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 34 changed files with 106 additions and 9 deletions (loading 32).

x
0 of 34 viewed, 34 left
56 additions and 4 deletionsapps/mobile/src/features/home/HomeScreen.tsxModified
View file
@@ -472,6 +472,10 @@
// boundary is actually crossed while the app stays open (mirrors web);
// without a clock dependency the partition memoizes a frozen "now".
const [nowMinute, setNowMinute] = useState(() => new Date().toISOString().slice(0, 16));
+ // Snooze wake times are second-precise; a counter bumped exactly at the
+ // next wake boundary re-runs the partition with a fresh clock so a woken
+ // thread reappears immediately instead of on the next minute tick.
+ const [snoozeWakeTick, bumpSnoozeWakeTick] = useState(0);
useEffect(() => {
if (!threadListV2Enabled) return;
// Refresh immediately on enable: the mount-time value can be hours old
@@ -493,8 +497,18 @@
return supported;
}, [serverConfigs]);
+ const snoozeEnvironmentIds = useMemo(() => {
+ const supported = new Set<EnvironmentId>();
+ for (const [environmentId, config] of serverConfigs) {
+ if (config.environment.capabilities.threadSnooze === true) {
+ supported.add(environmentId);
+ }
+ }
+ return supported;
+ }, [serverConfigs]);
const threadListV2Layout = useMemo(() => {
- if (!threadListV2Enabled) return { items: [], hiddenSettledCount: 0 };
+ if (!threadListV2Enabled)
+ return { items: [], hiddenSettledCount: 0, snoozedCount: 0, nextSnoozeWakeAt: null };
// Settled threads are live shells; archived threads keep their original