-
Notifications
You must be signed in to change notification settings - Fork 12
fix: contact book example: Make search great #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arnavnagzirkar
wants to merge
5
commits into
microsoft:main
Choose a base branch
from
arnavnagzirkar:fix-191
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
74c5d19
fix: contact book example: Make search great
arnavnagzirkar 990aad8
fix: wire search query into active page filtering
arnavnagzirkar 65c7468
refactor: model contact-book search as route query state
arnavnagzirkar fc64b32
fix: preserve group canonicalization and debounce search navigation
arnavnagzirkar 42e351d
fix: keep search box stable while a search debounce is pending
arnavnagzirkar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 13 additions & 8 deletions
21
examples/app/contact-book-manager/src/pages/cb-page-contacts/cb-page-contacts.html
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| <h2 class="page-title">All Contacts</h2> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| <if condition="contacts.length"> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| </if> | ||
| <if condition="!contacts.length"> | ||
| <cb-empty-state title="No contacts found" message="Try adjusting your search or add a new contact."></cb-empty-state> | ||
| </if> | ||
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
21 changes: 13 additions & 8 deletions
21
examples/app/contact-book-manager/src/pages/cb-page-favorites/cb-page-favorites.html
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| <h2 class="page-title">Favorites</h2> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| <if condition="contacts.length"> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| </if> | ||
| <if condition="!contacts.length"> | ||
| <cb-empty-state title="No contacts found" message="Try adjusting your search."></cb-empty-state> | ||
| </if> |
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
21 changes: 13 additions & 8 deletions
21
examples/app/contact-book-manager/src/pages/cb-page-group/cb-page-group.html
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,14 @@ | ||
| <h2 class="page-title">{{groupName}}</h2> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| <if condition="contacts.length"> | ||
| <div class="contact-list-container"> | ||
| <for each="contact in contacts"> | ||
| <cb-contact-card id="{{contact.id}}" first-name="{{contact.firstName}}" last-name="{{contact.lastName}}" | ||
| email="{{contact.email}}" phone="{{contact.phone}}" company="{{contact.company}}" group="{{contact.group}}" | ||
| favorite="{{contact.favorite}}" initials="{{contact.initials}}" avatar-color="{{contact.avatarColor}}" | ||
| notes="{{contact.notes}}" address="{{contact.address}}"></cb-contact-card> | ||
| </for> | ||
| </div> | ||
| </if> | ||
| <if condition="!contacts.length"> | ||
| <cb-empty-state title="No contacts found" message="Try adjusting your search."></cb-empty-state> | ||
| </if> |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repeats the contact-card loop and empty-state behavior that already exists in
cb-contact-list, and the same duplication is added to favorites/group. Can we reuse that component instead?Then the page TS only needs to import the list component:
If the page-specific container class is needed for styling, let's move/parameterize that in the shared list component rather than duplicating the loop in three pages.