Skip to content

feat(contacts): refactor contacts#3818

Open
ComputelessComputer wants to merge 11 commits intomainfrom
c-branch-5
Open

feat(contacts): refactor contacts#3818
ComputelessComputer wants to merge 11 commits intomainfrom
c-branch-5

Conversation

@ComputelessComputer
Copy link
Collaborator

@ComputelessComputer ComputelessComputer commented Feb 10, 2026

Summary

Refactors the contacts system with a unified selection model and adds pin/ordering support for organizations.

Core changes:

  • Replaced { selectedOrganization, selectedPerson } with a tagged union ContactsSelection ({ type: "person" | "organization", id })
  • Added created_at, pinned, pin_order fields to organization schema (zod + tinybase)
  • Added created_at to human schema
  • New contacts-list.tsx component with combined pinned list (people + orgs), drag-to-reorder, and sort options
  • Removed contacts permission check from calendar sidebar (no longer needed there)

Bug fixes (latest commit):

  • Fixed invalid nested <button> elements in PersonItem and OrganizationItem components (both contacts-list.tsx and organizations.tsx) — outer buttons replaced with <div role="button">
  • Added pin_order to organization and human frontmatter transforms (both toFrontmatter and fromFrontmatter directions) so pin order persists across sessions
  • Fixed pin order calculation to use cross-table max (both humans + organizations) when pinning, so new pins always sort to the end of the combined list

Review & Testing Checklist for Human

  • Tab state migration: The ContactsState shape changed from { selectedOrganization, selectedPerson } to { selected: ContactsSelection | null }. Verify that existing persisted tab states don't cause runtime errors on app load.
  • Keyboard accessibility: The <button><div role="button"> change in three components should still support Enter/Space activation and tab focus. Manually test keyboard navigation through the contacts list.
  • Pin order round-trip: pin_order defaults to 0 in organizationToFrontmatter / humanToFrontmatter for unpinned items. After a save+load cycle, unpinned items will have pin_order: 0 instead of undefined. Confirm this doesn't affect sort behavior (pinned items are filtered by pinned boolean, not pin_order).
  • Drag reorder of mixed pinned contacts: Pin a mix of people and organizations, then drag to reorder. Verify order persists after navigating away and back.

Suggested test plan: Open the contacts tab, create a few people and organizations, pin some of each, reorder the pinned list via drag, close and reopen the app, and verify the order and selection state are preserved.

Notes

  • The dprint fmt rustfmt errors are pre-existing (missing rustfmt component for the Rust toolchain) and unrelated to this PR.
  • Transform tests were updated for created_at but don't explicitly assert pin_order round-trip — may want to add those.

Link to Devin run: https://app.devin.ai/sessions/8172945c219e4a7689550c510b911cd7
Requested by: @ComputelessComputer


Open with Devin

@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit b42d800
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/698b0d57591bb800081e3aab

@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit b42d800
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/698b0d5780f3350007ee7c2d

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 7 additional findings.

Open in Devin Review

@ComputelessComputer ComputelessComputer force-pushed the c-branch-5 branch 3 times, most recently from 4e7fd98 to 84386d7 Compare February 10, 2026 10:03
Implement pinning functionality for organizations with drag and
reorder capabilities. Separate pinned and unpinned organizations,
add visual divider, and enable custom pinned order management.
@ComputelessComputer
Copy link
Collaborator Author

@yujonglee made changes to contacts view that involves adding to tinybase.

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 3 new potential issues.

View 12 additional findings in Devin Review.

Open in Devin Review

ComputelessComputer and others added 3 commits February 10, 2026 19:10
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
…rm.ts

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 13 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 4 new potential issues.

View 16 additional findings in Devin Review.

Open in Devin Review

…ss-table pin ordering

Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
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