Skip to content

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented May 29, 2025

Describe Your Changes

This pull request refactors the ThreadDetail component in web-app/src/routes/threads/$threadId.tsx to simplify thread data subscription and improve state management. The most important changes include removing the getThreadById function and directly subscribing to thread data using a state selector.

Refactor thread data subscription:

  • Removed the getThreadById function from the useThreads hook and replaced it with direct subscription to thread data using useShallow for improved reactivity.

Simplify state management:

  • Updated the useThreads destructuring to remove the unused getThreadById function.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Refactor ThreadDetail component in $threadId.tsx to remove getThreadById and directly subscribe to thread data using useShallow.

  • Refactor:
    • Remove getThreadById from useThreads in ThreadDetail component in $threadId.tsx.
    • Directly subscribe to thread data using useShallow for improved reactivity.
  • State Management:
    • Simplify useThreads destructuring by removing unused getThreadById.

This description was created by Ellipsis for 716e376. You can customize this summary. It will automatically update as commits are pushed.

@urmauur urmauur requested a review from louis-menlo May 29, 2025 17:53
@urmauur urmauur self-assigned this May 29, 2025
@urmauur urmauur added this to the v0.5.18 milestone May 29, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 716e376 in 45 seconds. Click for details.
  • Reviewed 26 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/src/routes/threads/$threadId.tsx:31
  • Draft comment:
    Removing getThreadById from the destructured state is good for cleanup, but ensure that no other part relies on it.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. web-app/src/routes/threads/$threadId.tsx:39
  • Draft comment:
    Directly subscribing to the thread data with a selector and useShallow improves reactivity. Verify that useThreads supports selector usage and that the reference in state.threads[threadId] stays stable to avoid extra renders.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_Xt65ZOwyYe9zSKtp

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@urmauur urmauur merged commit 3022fde into release/v0.5.18 May 30, 2025
19 checks passed
@urmauur urmauur deleted the fix/state-model-threadid branch May 30, 2025 06:05
@github-project-automation github-project-automation bot moved this to QA in Jan May 30, 2025
@github-actions github-actions bot modified the milestones: v0.5.18, v0.5.19 May 30, 2025
@david-menloai david-menloai moved this from QA to Done in Jan Jun 20, 2025
@LazyYuuki LazyYuuki removed this from the v0.7.2 milestone Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants