Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): stop the status label stacking on the row's settle actions #4826

ClosedSy-D(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/4826/headopened View on GitHub

Showing 3 changed files with 86 additions and 16 deletions.

x
0 of 3 viewed, 3 left
50 additions and 0 deletionsapps/web/src/components/Sidebar.logic.test.tsModified
View file
@@ -17,6 +17,7 @@
resolveSidebarStageBadgeLabel,
resolveThreadRowClassName,
resolveSidebarV2Status,
+ resolveSidebarV2StatusSlotClassNames,
resolveThreadStatusPill,
resolveWorkingStartedAt,
formatWorkingDurationLabel,
@@ -654,6 +655,55 @@
});
});
​
+describe("resolveSidebarV2StatusSlotClassNames", () => {
+ // The label and the actions share one slot, so the states must be
+ // mutually exclusive: a variant that reveals the actions without fading
+ // the label leaves "Working" stacked on top of "Settle".
+ const revealVariants = (className: string): ReadonlyArray<string> =>
+ className
+ .split(" ")
+ .filter((candidate) => candidate.endsWith(":opacity-100"))
+ .map((candidate) => candidate.slice(0, -":opacity-100".length));
+​
+ it("fades the status label out for every variant that reveals the actions", () => {
+ for (const snoozeMenuOpen of [false, true]) {
+ const { statusClassName, actionsClassName } = resolveSidebarV2StatusSlotClassNames({
+ snoozeMenuOpen,
+ });
+ const variants = revealVariants(actionsClassName);
+ expect(variants.length).toBeGreaterThan(0);