Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): avoid nested dropdowns for single tools #15674

MergedStiensWout(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/15674/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 20 additions and 13 deletions (loading 2).

x
0 of 4 viewed, 4 left
15 additions and 9 deletionsapps/mobile/src/features/threads/ThreadFeed.tsxModified
View file
@@ -1529,7 +1529,7 @@
readonly failedRunIds: ReadonlySet<RunId>;
readonly onCopyWorkRow: (rowId: string, value: string) => void;
readonly onToggleWorkGroup: (groupId: string, anchorKey?: string) => void;
- readonly onToggleWorkRow: (rowId: string, anchorKey?: string) => void;
+ readonly onToggleWorkRow: (rowId: string, anchorKey?: string, groupId?: string) => void;
readonly onToggleTurnFold: (runId: RunId) => void;
readonly onPressPreview: (source: FilePreviewSource) => void;
readonly onPressVideo: (attachment: ChatFileAttachment, sourceIdentifier: string) => void;
@@ -2826,16 +2826,22 @@
[suspendEndScrollMaintenanceForDisclosure],
+ // A lone call's row stands in for its group header, so both disclosures move
+ // together. Details the reader opened stay open when a second call turns the
+ // row into a group.
const onToggleWorkRow = useCallback(
- (rowId: string, anchorKey?: string) => {
+ (rowId: string, anchorKey?: string, groupId?: string) => {
suspendEndScrollMaintenanceForDisclosure(anchorKey ?? null);
- setInteractionState((current) => ({
- ...current,
- expandedWorkRows: {
- ...current.expandedWorkRows,
- [rowId]: !(current.expandedWorkRows[rowId] ?? false),
- },
- }));
+ setInteractionState((current) => {
+ const expanded = !(current.expandedWorkRows[rowId] ?? false);