Skip to content

Mark selected thread as visited in web store - #74

Merged
juliusmarminge merged 1 commit into
mainfrom
codething/3adde026
Feb 19, 2026
Merged

juliusmarminge merged 1 commit into
mainfrom
codething/3adde026

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Feb 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • dispatch MARK_THREAD_VISITED whenever activeThreadId changes in apps/web/src/routes/__root.tsx
  • add reducer support for MARK_THREAD_VISITED in apps/web/src/store.ts, defaulting visitedAt to current ISO time when omitted
  • add a reducer test in apps/web/src/store.test.ts to verify selecting a thread updates lastVisitedAt

Testing

  • apps/web/src/store.test.ts: added marks a thread as visited when selected to assert lastVisitedAt is updated to the provided timestamp
  • Lint: Not run
  • Full test suite: Not run

Open with Devin

Note

Low Risk
Small, localized state-update change affecting only thread metadata (lastVisitedAt) plus a new reducer test; no auth/security or data persistence format changes.

Overview
Updates the web UI to record thread visit time on selection by dispatching MARK_THREAD_VISITED whenever activeThreadId changes.

Adds reducer support for MARK_THREAD_VISITED to update a thread’s lastVisitedAt (defaulting to the current ISO timestamp when omitted), and introduces a unit test ensuring selecting a thread updates lastVisitedAt as expected.

Written by Cursor Bugbot for commit cd9ef00. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features
    • Threads now automatically record when they are last visited.

- Dispatch `MARK_THREAD_VISITED` when `activeThreadId` changes in root route
- Add reducer handling to update a thread's `lastVisitedAt`
- Add reducer test coverage for selecting a thread updates visit time
@coderabbitai

coderabbitai Bot commented Feb 19, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

The PR introduces thread visit tracking by adding a new MARK_THREAD_VISITED action to the store. The action updates a thread's lastVisitedAt timestamp, and is dispatched from the root route component whenever a thread becomes active.

Changes

Cohort / File(s) Summary
Store Layer
apps/web/src/store.ts, apps/web/src/store.test.ts
Added MARK_THREAD_VISITED action variant with threadId and optional visitedAt fields. Implemented reducer logic to update the target thread's lastVisitedAt timestamp using the provided visitedAt or current ISO timestamp. Includes test case verifying the timestamp update behavior.
Route Layer
apps/web/src/routes/__root.tsx
Added effect in EventRouter that dispatches MARK_THREAD_VISITED action when activeThreadId is present, passing the thread ID and current timestamp.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codething/3adde026

Comment @coderabbitai help to get the list of available commands and usage tips.

@juliusmarminge
juliusmarminge merged commit eecb534 into main Feb 19, 2026
4 of 5 checks passed
@macroscopeapp

macroscopeapp Bot commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

Mark active threads as visited in the web store by dispatching MARK_THREAD_VISITED from EventRouter with a current ISO timestamp

Add MARK_THREAD_VISITED handling in the store reducer to set lastVisitedAt, dispatch it from EventRouter when activeThreadId is present, and add a unit test for the reducer.

📍Where to Start

Start with the EventRouter effect in __root.tsx, then review the MARK_THREAD_VISITED case in store.ts.


Macroscope summarized cd9ef00.

@greptile-apps

greptile-apps Bot commented Feb 19, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds automatic thread visit tracking when a user selects a thread, updating the lastVisitedAt timestamp to help distinguish visited from unvisited threads in the UI.

  • Dispatches MARK_THREAD_VISITED action whenever activeThreadId changes in the root component
  • Reducer supports optional visitedAt parameter, defaulting to current ISO timestamp when omitted
  • Test coverage added to verify the visit timestamp update behavior

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Simple, well-tested feature addition with clear logic flow. The change follows existing patterns in the codebase (similar to how turn/completed updates lastVisitedAt), includes test coverage, and has minimal surface area for bugs.
  • No files require special attention

Important Files Changed

Filename Overview
apps/web/src/routes/__root.tsx Added useEffect to dispatch MARK_THREAD_VISITED when activeThreadId changes, updating thread visit tracking
apps/web/src/store.ts Added MARK_THREAD_VISITED action type and reducer case to update lastVisitedAt with optional timestamp defaulting to current time
apps/web/src/store.test.ts Added test case verifying MARK_THREAD_VISITED action correctly updates lastVisitedAt to provided timestamp

Sequence Diagram

sequenceDiagram
    participant User
    participant Router as __root.tsx
    participant Store as store.ts
    participant State as AppState

    User->>Router: Navigate to thread
    Router->>Router: activeThreadId changes (useParams)
    Router->>Router: useEffect triggers
    Router->>Store: dispatch(MARK_THREAD_VISITED)
    Note over Store: visitedAt = action.visitedAt ?? new Date().toISOString()
    Store->>Store: reducer(MARK_THREAD_VISITED)
    Store->>State: updateThread(lastVisitedAt)
    State-->>User: Thread marked as visited
Loading

Last reviewed commit: cd9ef00

@chrisu-dev chrisu-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FAIL — verified the GitHub test-merge b30cf956588d75d4cbeee44338adde5a2479bb12 (head 8723cdca69cd09733337c19ad2b780326fc3ae1a onto staging base 654119b0de8f9462dd974abe9273993a03ad9f7f). No merge.

Blocking finding

  1. withDesktopBuildVersionStamp can leave the release manifests partially stamped when the stamping step itself fails. In scripts/build-desktop-artifact.ts, the restoration Effect.ensuring is installed only after updateReleasePackageVersions returns; that helper writes the four manifests sequentially. I reproduced this against the landing tree with fresh four-manifest fixtures: make the second manifest (apps/desktop/package.json) non-writable, then run withDesktopBuildVersionStamp for 0.0.34-thais.27-staging.2. The helper failed as expected on the second write, but apps/server/package.json remained changed to 0.0.34-thais.27-staging.2 while the other three remained 0.0.34. This contradicts the stated scoped-mutation guarantee that the working tree is restored on failure/interruption. Install restoration around both the stamping phase and the build once originals are captured, and add a red-first test for a failure after at least one manifest has been written.

Independent evidence

  • Focused + adjacent tests: exit 0, 2 files / 74 tests passed.
  • node_modules/.bin/tsgo --noEmit -p scripts/tsconfig.json: exit 0 (one non-failing Effect suggestion at the unchanged line 1666).
  • Focused lint on the changed script and suite: exit 0.
  • bin/check-seams.sh: exit 0.
  • bin/check-focor-registry.sh: exit 0.
  • git diff --check: exit 0.
  • Verified the production regex/identity path separately: plain X.Y.Z-thais.N keeps the production product name, app id, and icons; staging versions select the staging identity and passkey app id.

The review scratch checkout and fixtures were removed before posting this verdict.

@chrisu-dev

Copy link
Copy Markdown

Correction: the immediately preceding review from chrisu-dev was posted here by repository-routing error while reviewing Focor/thais#74. It is unrelated to this already-merged upstream PR and should be ignored.

HaukeSchnau added a commit to HaukeSchnau/t3code that referenced this pull request Sep 29, 2026
…otgg#59)' (pingdotgg#74) from land/mobile-cloud-code into main

merge: land mobile cloud code switched off (pingdotgg#74)
i2cjak added a commit to i2cjak/Backplane that referenced this pull request Sep 29, 2026
…perf

Smooth sidebar scrolling, auto-loading history, all scripts drawn, 50 agents without lag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants