fix(mobile): shimmer active tool rows (#8932)
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
35da581331
commit
5ce92c2f19
3 files changed
+25
-7
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
type ColorValue,
|
||||
Pressable,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from "react-native";
|
||||
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
||||
@@ -143,7 +144,7 @@ function ShimmeringWorkContent(props: {
|
||||
|
||||
return (
|
||||
<View
|
||||
className="min-w-0 flex-1"
|
||||
className="min-w-0 flex-1 overflow-hidden"
|
||||
onLayout={(event) => setAvailableWidth(event.nativeEvent.layout.width)}
|
||||
>
|
||||
<ShimmerWorkContent
|
||||
@@ -164,7 +165,7 @@ function ShimmeringWorkContent(props: {
|
||||
style={[{ width: SHIMMER_WIDTH }, sweepStyle]}
|
||||
>
|
||||
<MaskedView
|
||||
className="absolute inset-0"
|
||||
style={StyleSheet.absoluteFill}
|
||||
maskElement={
|
||||
<Svg width="100%" height="100%">
|
||||
<Defs>
|
||||
|
||||
@@ -942,8 +942,27 @@ describe("buildThreadFeed", () => {
|
||||
summary: "Running pnpm",
|
||||
summaryKind: "command",
|
||||
live: true,
|
||||
shimmer: false,
|
||||
shimmer: true,
|
||||
});
|
||||
expect(rows[0]).toMatchObject({ live: false, shimmer: false });
|
||||
|
||||
const stoppedRows = deriveThreadFeedPresentation(feed, latestTurn, new Set());
|
||||
expect(stoppedRows.filter((entry) => entry.type === "work-toggle")).toMatchObject([
|
||||
{ live: false, shimmer: false },
|
||||
{ live: false, shimmer: false },
|
||||
]);
|
||||
|
||||
const completedRows = deriveThreadFeedPresentation(
|
||||
feed,
|
||||
{ ...latestTurn, state: "completed", completedAt: "2026-04-01T00:00:04.000Z" },
|
||||
new Set([turnId]),
|
||||
new Set(),
|
||||
latestTurn.startedAt,
|
||||
);
|
||||
expect(completedRows.filter((entry) => entry.type === "work-toggle")).toMatchObject([
|
||||
{ live: false, shimmer: false },
|
||||
{ live: false, shimmer: false },
|
||||
]);
|
||||
});
|
||||
|
||||
it("does not revive cached in-progress tools after work stops", () => {
|
||||
|
||||
@@ -1512,10 +1512,8 @@ function appendToolGroupRows(
|
||||
),
|
||||
hasFailure: activities.findLast((activity) => activity.toolLike)?.status === "failure",
|
||||
live,
|
||||
shimmer:
|
||||
isWorking &&
|
||||
latestActivity.lifecycleStatus === "inProgress" &&
|
||||
latestActivity.turnId === unsettledTurnId,
|
||||
// Match the live label until the turn or contiguous tool run settles.
|
||||
shimmer: live,
|
||||
});
|
||||
if (!expanded) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user