-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Consolidate AgentZero status into a Context #85535
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
adhorodyski
wants to merge
14
commits into
Expensify:main
Choose a base branch
from
callstack-internal:decompose/agent-zero-status-context
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.
+555
−1,397
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bbc1155
Consolidate AgentZero status into a shared context provider
adhorodyski 24d20dd
Split AgentZero context into state and actions providers
adhorodyski e152383
Merge remote-tracking branch 'exfy/main' into decompose/agent-zero-st…
adhorodyski 7c1c53a
chore: trigger CI re-run after upstream merge
adhorodyski 498a5bd
Use imported ReasoningEntry type instead of inline duplication
adhorodyski cd080bb
Suppress thinking bubble and typing indicator during side-panel welco…
adhorodyski ff6322c
Merge branch 'Expensify:main' into decompose/agent-zero-status-context
adhorodyski f21ad4a
Merge branch 'Expensify:main' into decompose/agent-zero-status-context
adhorodyski 773377e
chore: fix inline def with getReportChannelName
adhorodyski a94cce1
Add documentation to AgentZeroStatusContext state and internals
adhorodyski 192df9f
Move indicator suppression from context to self-subscribing consumer …
adhorodyski cf71724
fix: accept optional reportID in useShouldSuppressConciergeIndicators
adhorodyski 743d7fd
Merge remote-tracking branch 'exfy/main' into decompose/agent-zero-st…
adhorodyski b93412a
Merge branch 'Expensify:main' into decompose/agent-zero-status-context
adhorodyski 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
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import {isCreatedAction} from '@libs/ReportActionsUtils'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type {ReportActions} from '@src/types/onyx/ReportAction'; | ||
| import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails'; | ||
| import useIsInSidePanel from './useIsInSidePanel'; | ||
| import useOnyx from './useOnyx'; | ||
| import useSidePanelState from './useSidePanelState'; | ||
|
|
||
| /** | ||
| * Returns true when thinking/typing indicators should be hidden in the side-panel | ||
| * welcome state — specifically for Concierge DMs before the user sends their first message. | ||
| */ | ||
| function useShouldSuppressConciergeIndicators(reportID: string | undefined): boolean { | ||
| const isInSidePanel = useIsInSidePanel(); | ||
| const {sessionStartTime} = useSidePanelState(); | ||
| const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails(); | ||
| const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); | ||
|
|
||
| const isConciergeChat = reportID === conciergeReportID; | ||
|
|
||
| const hasUserSentMessageSelector = (actions: OnyxEntry<ReportActions>) => { | ||
| if (!actions || !sessionStartTime) { | ||
| return false; | ||
| } | ||
| return Object.values(actions).some((action) => !isCreatedAction(action) && action.actorAccountID === currentUserAccountID && action.created >= sessionStartTime); | ||
| }; | ||
| // eslint-disable-next-line rulesdir/no-inline-useOnyx-selector -- React Compiler handles memoization | ||
| const [hasUserSentMessage] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, { | ||
| selector: hasUserSentMessageSelector, | ||
| }); | ||
|
|
||
| return isConciergeChat && isInSidePanel && !hasUserSentMessage; | ||
| } | ||
|
|
||
| export default useShouldSuppressConciergeIndicators; | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.
Could we remove this disabled line?
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.
I think so, looks like an artifact from Opus. Doing this now.