Skip to content

Fix navigation login state and improve user activity stats#506

Merged
bokelley merged 1 commit into
mainfrom
bokelley/fix-login-display
Jan 3, 2026
Merged

Fix navigation login state and improve user activity stats#506
bokelley merged 1 commit into
mainfrom
bokelley/fix-login-display

Conversation

@bokelley

@bokelley bokelley commented Jan 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix navigation showing "Log in/Sign up" when user is authenticated - The getUserFromRequest() function wasn't refreshing expired WorkOS sessions, causing the nav bar to show logged-out state even when API calls correctly authenticated the user. Now properly refreshes the session and updates the cookie.

  • Hide empty activity stats - No longer display "0 Messages" and "0 Active Days" when there's no activity - not useful UX.

  • Include web chat messages in user stats - Previously only counted Slack activity. Now queries the unified addie_threads table which includes both Slack and web chat conversations, so users who prefer web chat see their activity reflected.

Test plan

  • Verify navigation shows logged-in state after page load with valid session
  • Verify navigation still shows logged-in state when session needs refresh
  • Verify "Your Stats" section hides when user has no messages/activity
  • Verify "Your Stats" section shows combined Slack + web chat activity

🤖 Generated with Claude Code

- Fix navigation showing "Log in/Sign up" when user is authenticated by adding
  session refresh to `getUserFromRequest()` and updating the cookie when refreshed
- Hide "0 Messages" and "0 Active Days" stats when there's no activity
- Include web chat messages in user stats alongside Slack activity by:
  - Adding `getUserActivityStats()` method to thread-service.ts
  - Adding `conversation_activity` to member context
  - Updating stats builder and renderer to prefer combined stats
- Use `last_message_at` instead of `started_at` for active days calculation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit a3fd002 into main Jan 3, 2026
6 checks passed
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.

1 participant