feat(contacts): refactor contacts#3818
Open
ComputelessComputer wants to merge 11 commits intomainfrom
Open
Conversation
✅ Deploy Preview for hyprnote-storybook canceled.
|
✅ Deploy Preview for hyprnote canceled.
|
30b2317 to
71ba18f
Compare
4e7fd98 to
84386d7
Compare
Implement pinning functionality for organizations with drag and reorder capabilities. Separate pinned and unpinned organizations, add visual divider, and enable custom pinned order management.
84386d7 to
f3e7569
Compare
Collaborator
Author
|
@yujonglee made changes to contacts view that involves adding to tinybase. |
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>
…ss-table pin ordering Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the contacts system with a unified selection model and adds pin/ordering support for organizations.
Core changes:
{ selectedOrganization, selectedPerson }with a tagged unionContactsSelection({ type: "person" | "organization", id })created_at,pinned,pin_orderfields to organization schema (zod + tinybase)created_atto human schemacontacts-list.tsxcomponent with combined pinned list (people + orgs), drag-to-reorder, and sort optionsBug fixes (latest commit):
<button>elements inPersonItemandOrganizationItemcomponents (bothcontacts-list.tsxandorganizations.tsx) — outer buttons replaced with<div role="button">pin_orderto organization and human frontmatter transforms (bothtoFrontmatterandfromFrontmatterdirections) so pin order persists across sessionsReview & Testing Checklist for Human
ContactsStateshape changed from{ selectedOrganization, selectedPerson }to{ selected: ContactsSelection | null }. Verify that existing persisted tab states don't cause runtime errors on app load.<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_orderdefaults to0inorganizationToFrontmatter/humanToFrontmatterfor unpinned items. After a save+load cycle, unpinned items will havepin_order: 0instead ofundefined. Confirm this doesn't affect sort behavior (pinned items are filtered bypinnedboolean, notpin_order).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
dprint fmtrustfmt errors are pre-existing (missing rustfmt component for the Rust toolchain) and unrelated to this PR.created_atbut don't explicitly assertpin_orderround-trip — may want to add those.Link to Devin run: https://app.devin.ai/sessions/8172945c219e4a7689550c510b911cd7
Requested by: @ComputelessComputer