Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions esp/src/src-dojo/nls/hpcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ export = {
Graphs: "Graphs",
GraphControl: "Graph Control",
GraphView: "Graph View",
Grid: "Grid",
GridAbortMessage: "Grid aborting stale request",
Group: "Group",
GroupBy: "Group By",
Expand Down Expand Up @@ -513,6 +514,7 @@ export = {
Line: "Line",
LineTerminators: "Line Terminators",
Links: "Links",
List: "List",
ListECLWorkunit: "List ECL Workunit",
ListDFUWorkunit: "List DFU Workunit",
LoadPackageContentHere: "(Load package content here)",
Expand Down
12 changes: 9 additions & 3 deletions esp/src/src-react/components/ActivitiesCards.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import * as React from "react";
import { Toolbar, ToolbarButton, Divider } from "@fluentui/react-components";
import { ArrowClockwise20Regular } from "@fluentui/react-icons";
import { Toolbar, ToolbarButton, ToolbarDivider, Divider } from "@fluentui/react-components";
import { ArrowClockwise20Regular, Grid20Regular, TextAlignLeft20Regular } from "@fluentui/react-icons";
import nlsHPCC from "src/nlsHPCC";
import { QueueCards } from "./cards/QueueCard";
import { HolyGrail } from "../layouts/HolyGrail";
import { SizeMe } from "../layouts/SizeMe";
import { useBuildInfo } from "../hooks/platform";
import { useUserStore } from "../hooks/store";
import { DiskUsageCards } from "./cards/DiskUsageCard";

interface ActivitiesProps {
Expand All @@ -15,13 +16,18 @@ export const Activities: React.FunctionComponent<ActivitiesProps> = ({
}) => {
const [, { isContainer }] = useBuildInfo();
const [refreshToken, setRefreshToken] = React.useState(0);
const [listMode, setListMode] = useUserStore("ACTIVITIES_LIST_MODE", false);

return <HolyGrail
header={
<Toolbar>
<ToolbarButton appearance="subtle" icon={<ArrowClockwise20Regular />} aria-label={nlsHPCC.Refresh} onClick={() => setRefreshToken(t => t + 1)}>
{nlsHPCC.Refresh}
</ToolbarButton>
<ToolbarDivider />
<ToolbarButton appearance="subtle" icon={listMode ? <Grid20Regular /> : <TextAlignLeft20Regular />} aria-label={listMode ? nlsHPCC.Grid : nlsHPCC.List} onClick={() => setListMode(!listMode)}>
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The click handler uses setListMode(!listMode), which can read a stale value if updates are batched. Prefer the functional form so the toggle is derived from the latest state (e.g., setListMode(prev => !prev)).

Suggested change
<ToolbarButton appearance="subtle" icon={listMode ? <Grid20Regular /> : <TextAlignLeft20Regular />} aria-label={listMode ? nlsHPCC.Grid : nlsHPCC.List} onClick={() => setListMode(!listMode)}>
<ToolbarButton appearance="subtle" icon={listMode ? <Grid20Regular /> : <TextAlignLeft20Regular />} aria-label={listMode ? nlsHPCC.Grid : nlsHPCC.List} onClick={() => setListMode(prev => !prev)}>

Copilot uses AI. Check for mistakes.
{listMode ? nlsHPCC.Grid : nlsHPCC.List}
</ToolbarButton>
</Toolbar>
}
main={
Expand All @@ -39,7 +45,7 @@ export const Activities: React.FunctionComponent<ActivitiesProps> = ({
}
<>
<Divider>{nlsHPCC.Activities}</Divider>
<QueueCards refreshToken={refreshToken} />
<QueueCards refreshToken={refreshToken} listMode={listMode} />
</>
</div>
</div>;
Expand Down
Loading
Loading