Skip to content

clean up tb#29064

Merged
chrisnojima merged 4 commits intonojima/HOTPOT-next-670-cleanfrom
nojima/ZCLIENT-tb-clean
Mar 31, 2026
Merged

clean up tb#29064
chrisnojima merged 4 commits intonojima/HOTPOT-next-670-cleanfrom
nojima/ZCLIENT-tb-clean

Conversation

@chrisnojima-zoom
Copy link
Copy Markdown
Contributor

@chrisnojima-zoom chrisnojima-zoom commented Mar 25, 2026

  • test

@chrisnojima chrisnojima force-pushed the nojima/ZCLIENT-tb-clean branch from 950b399 to c071cbe Compare March 31, 2026 13:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the Team Building (TB) UI code to reduce duplication and improve readability, including extracting helpers/types, consolidating store selectors, and simplifying some UI mapping logic.

Changes:

  • Removes/rewrites several large prop/type “Pick” usages in favor of local prop types and helper functions across TB components.
  • Simplifies service accent color selection and tab-bar click handling on native/desktop.
  • Consolidates several Zustand store reads using C.useShallow(...) and restructures TB list-body data/handlers.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
shared/team-building/types.tsx Removes an exported Props type that was previously used for Pick<...> patterns.
shared/team-building/shared.tsx Replaces a switch with map-based service accent color lookup.
shared/team-building/service-tab-bar.native.tsx Cleans up unused props and simplifies onClick wiring.
shared/team-building/service-tab-bar.desktop.tsx Extracts desktop service layout logic into a helper.
shared/team-building/search-result/people-result.tsx Simplifies dropdown prop wiring and extracts menu item construction.
shared/team-building/search-result/common-result.tsx Extracts small helpers/components to clarify rendering logic.
shared/team-building/recs-and-recos.tsx Replaces Pick<Types.Props,...> with explicit local prop types; minor refactors.
shared/team-building/list-body.tsx Major refactor: helper extraction, consolidated selectors, and clearer effect logic.
shared/team-building/index.tsx Refactors TeamBuilding component by extracting “data” and “actions” hooks/helpers.
shared/team-building/filtered-service-tab-bar.tsx Extracts visible-services computation into a helper.
shared/team-building/contacts.tsx Consolidates settings-contact store reads using C.useShallow(...).
shared/constants/types/team-building.tsx Changes SearchResults typing to readonly map types.
AGENTS.md Adds (duplicate) guidance about preferring consolidated selectors with C.useShallow(...).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export type Query = string

export type SearchResults = Map<Query, Map<ServiceIdWithContact, Array<User>>>
export type SearchResults = ReadonlyMap<Query, ReadonlyMap<ServiceIdWithContact, ReadonlyArray<User>>>
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

SearchResults was changed to ReadonlyMap<...>, but the team-building store mutates searchResults (via mapGetEnsureValue(...).set(...) in shared/stores/team-building.tsx). This type change will break TypeScript compilation unless the store is updated or the type remains mutable. Consider keeping SearchResults as a Map, or introducing a separate exported ReadonlySearchResults type for consumers while the store keeps a mutable Map internally.

Suggested change
export type SearchResults = ReadonlyMap<Query, ReadonlyMap<ServiceIdWithContact, ReadonlyArray<User>>>
export type SearchResults = Map<Query, Map<ServiceIdWithContact, ReadonlyArray<User>>>
export type ReadonlySearchResults = ReadonlyMap<Query, ReadonlyMap<ServiceIdWithContact, ReadonlyArray<User>>>

Copilot uses AI. Check for mistakes.
AGENTS.md Outdated
- Do not add new exported functions, types, or constants unless they are required outside the file. Prefer file-local helpers for one-off implementation details and tests.
- During refactors, do not delete existing guards, conditionals, or platform/test-specific behavior unless you have proven they are dead and the user asked for that behavior change. Port checks like `androidIsTestDevice` forward into the new code path instead of silently dropping them.
- When addressing PR or review feedback, including bot or lint-style suggestions, do not apply it mechanically. Verify that the reported issue is real in this codebase and that the proposed fix is consistent with repo rules and improves correctness, behavior, or maintainability before making changes.
- When a component reads multiple adjacent values from the same store hook, prefer a consolidated selector with `C.useShallow(...)` instead of multiple separate subscriptions.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

AGENTS.md now contains the same guidance about consolidating store subscriptions with C.useShallow(...) twice (lines 6 and 10). Please remove the duplicate entry to avoid confusion and keep the repo notes concise.

Suggested change
- When a component reads multiple adjacent values from the same store hook, prefer a consolidated selector with `C.useShallow(...)` instead of multiple separate subscriptions.

Copilot uses AI. Check for mistakes.
onSearchForMore: (len: number) => void
onChangeText: (newText: string) => void
onFinishTeamBuilding: () => void
offset: unknown
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

ListBodyProps still requires an offset prop, but ListBody no longer destructures or uses it anywhere in this file. If it’s no longer needed, drop it from the prop type (and call sites); if it is needed for animations/scroll behavior, wire it into the relevant component rather than leaving it unused.

Suggested change
offset: unknown

Copilot uses AI. Check for mistakes.
@chrisnojima chrisnojima merged commit e873655 into nojima/HOTPOT-next-670-clean Mar 31, 2026
@chrisnojima chrisnojima deleted the nojima/ZCLIENT-tb-clean branch March 31, 2026 15:15
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