Skip to content

fix(desktop): fix typecheck error in WorkspaceListItem#1282

Merged
AviPeltz merged 1 commit into
mainfrom
avipeltz/fix-typecheck
Feb 7, 2026
Merged

fix(desktop): fix typecheck error in WorkspaceListItem#1282
AviPeltz merged 1 commit into
mainfrom
avipeltz/fix-typecheck

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Feb 7, 2026

Summary

  • Fixed a TypeScript error in WorkspaceListItem where a RefObject<HTMLElement> was being passed directly to a <button> element that expects Ref<HTMLButtonElement>
  • Uses a ref callback instead, which safely widens HTMLButtonElement to HTMLElement on assignment — consistent with the pattern already used by the expanded view's <div> ref

Test plan

  • bun run typecheck passes across all 17 packages

Summary by CodeRabbit

No user-facing changes in this release. Internal code improvements have been made to enhance stability.

…tton

Use ref callback instead of passing RefObject directly to avoid
HTMLElement vs HTMLButtonElement type incompatibility.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 7, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Refactors the collapsed item's ref assignment from direct assignment to a callback ref pattern, ensuring the DOM node is properly assigned to itemRef.current during mounting and unmounting lifecycle phases.

Changes

Cohort / File(s) Summary
Ref handling refactor
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/WorkspaceListItem.tsx
Converts direct ref assignment to callback ref pattern for improved lifecycle handling of the collapsed item's DOM node reference.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A ref in callback form does bind,
Where current flows with mounting's mind,
No longer direct, but assured and tight,
The DOM node dances just right! ✨

✨ 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 avipeltz/fix-typecheck

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@AviPeltz AviPeltz merged commit 0038ccb into main Feb 7, 2026
5 of 6 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 7, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

@Kitenite Kitenite deleted the avipeltz/fix-typecheck branch February 9, 2026 01:19
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