Skip to content

Fix deleted vs not-found comment state#595

Merged
horacioh merged 4 commits into
mainfrom
Delete-vs-notfound
May 19, 2026
Merged

Fix deleted vs not-found comment state#595
horacioh merged 4 commits into
mainfrom
Delete-vs-notfound

Conversation

@GaboHBeaumont
Copy link
Copy Markdown
Collaborator

Summary

  • use a direct subscribed resource lookup for the opened comment in CommentDiscussions
  • distinguish exact focused comment states: render comment, deleted preview, deleted, loading, or not-found
  • add unit tests for the focused comment state resolver

Testing

  • not run: frontend dependencies are not installed in this workspace (node_modules missing)
  • attempted corepack pnpm --filter @shm/ui typecheck
  • attempted corepack pnpm --filter @shm/ui test

@ericvicenti
Copy link
Copy Markdown
Collaborator

@GaboHBeaumont if you have tested this, and once the tests are passing, feel free to merge!

btw, this getFocusedCommentViewState function does not look very helpful and I would prefer if that code was just inlined at the place where it is being used. a helper function is only helpful if the logic is being used in more than one place

I have a feeling it was done this way because of the agent's eagerness to write another super-obvious test 😂

@GaboHBeaumont
Copy link
Copy Markdown
Collaborator Author

Great! thanks!

@GaboHBeaumont
Copy link
Copy Markdown
Collaborator Author

@ericvicenti done — I inlined that state logic in and removed the extra helper + test.

@GaboHBeaumont
Copy link
Copy Markdown
Collaborator Author

@ericvicenti done — I inlined that state logic in comments.tsx and removed the extra helper + test.

@horacioh horacioh force-pushed the Delete-vs-notfound branch from cc949af to f4d8e1b Compare May 19, 2026 10:04
@horacioh horacioh merged commit e6c8f4c into main May 19, 2026
8 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.

3 participants