Skip to content

Commit 72d402f

Browse files
committed
UI tweaks
1 parent c84a8a0 commit 72d402f

3 files changed

Lines changed: 45 additions & 7 deletions

File tree

streamlit_pivot/frontend/src/config/Toolbar.test.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,21 @@ describe("Toolbar - settings panel", () => {
16671667
expect(screen.getByTestId("toolbar-settings")).toBeInTheDocument();
16681668
});
16691669

1670+
it("does not pin the utility menu open just because locked mode is enabled", () => {
1671+
render(
1672+
<Toolbar
1673+
config={makeConfig()}
1674+
allColumns={ALL_COLUMNS}
1675+
numericColumns={NUMERIC_COLUMNS}
1676+
onConfigChange={vi.fn()}
1677+
locked={true}
1678+
/>,
1679+
);
1680+
expect(
1681+
screen.getByRole("toolbar", { name: "Table actions" }).className,
1682+
).not.toContain("utilGroupPinned");
1683+
});
1684+
16701685
it("locked mode settings panel shows status rows", () => {
16711686
render(
16721687
<Toolbar
@@ -2485,6 +2500,22 @@ describe("Toolbar – DnD rendering", () => {
24852500
screen.getAllByText("Apply fields in settings menu").length,
24862501
).toBeGreaterThanOrEqual(1);
24872502
});
2503+
2504+
it("hides the empty drop zone placeholder in locked mode", () => {
2505+
render(
2506+
<Toolbar
2507+
config={makeConfig({ rows: [], columns: [], values: [] })}
2508+
allColumns={ALL_COLUMNS}
2509+
numericColumns={NUMERIC_COLUMNS}
2510+
onConfigChange={vi.fn()}
2511+
locked={true}
2512+
/>,
2513+
);
2514+
expect(
2515+
screen.queryByText("Apply fields in settings menu"),
2516+
).not.toBeInTheDocument();
2517+
expect(screen.queryByText("Drag fields here")).not.toBeInTheDocument();
2518+
});
24882519
});
24892520

24902521
// ---------------------------------------------------------------------------

streamlit_pivot/frontend/src/config/Toolbar.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ const Toolbar: FC<ToolbarProps> = ({
498498

499499
// Zone card content helpers
500500
const syntheticMeasures = config.synthetic_measures ?? [];
501-
const emptyHint = "Apply fields in settings menu";
501+
const emptyHint = locked ? undefined : "Apply fields in settings menu";
502502

503503
return (
504504
<div
@@ -606,7 +606,7 @@ const Toolbar: FC<ToolbarProps> = ({
606606

607607
<div
608608
ref={utilGroupRef}
609-
className={`${styles.utilGroup} ${locked || settingsOpen ? styles.utilGroupPinned : ""}`}
609+
className={`${styles.utilGroup} ${settingsOpen ? styles.utilGroupPinned : ""}`}
610610
role="toolbar"
611611
aria-label="Table actions"
612612
onKeyDown={(e) => {
@@ -861,8 +861,10 @@ const ZoneCard: FC<ZoneCardProps> = ({
861861
aggTestIdPrefix,
862862
displayLabelForField,
863863
isValues,
864-
emptyHint = "Drag fields here",
864+
emptyHint,
865865
}): ReactElement => {
866+
const resolvedEmptyHint =
867+
emptyHint ?? (disabled ? undefined : "Drag fields here");
866868
const { setNodeRef: setDroppableRef } = useDroppable({
867869
id: zoneId,
868870
data: { type: "container" },
@@ -958,9 +960,9 @@ const ZoneCard: FC<ZoneCardProps> = ({
958960
</span>
959961
))}
960962
</div>
961-
) : (
962-
<div className={styles.emptyDropZone}>{emptyHint}</div>
963-
)}
963+
) : resolvedEmptyHint ? (
964+
<div className={styles.emptyDropZone}>{resolvedEmptyHint}</div>
965+
) : null}
964966
</SortableContext>
965967
</div>
966968
);

streamlit_pivot/frontend/src/renderers/TableRenderer.module.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,15 @@
478478

479479
/* Grouping dimension column header styling */
480480
.groupingDimHeader {
481-
font-weight: 700;
481+
font-weight: inherit;
482482
border-bottom-width: 2px;
483483
}
484484

485+
.headerCell.rowHeaderPrimary,
486+
.headerCell.rowHeaderSecondary {
487+
font-weight: 500;
488+
}
489+
485490
/* --- Dimension-level collapse toggle --- */
486491

487492
.dimensionToggleCell {

0 commit comments

Comments
 (0)