From fb47545e0e5659218141590d6ea6dc0b5ece871f Mon Sep 17 00:00:00 2001 From: morepriyam Date: Tue, 13 Oct 2026 17:49:51 -0400 Subject: [PATCH 1/5] fix(clock): the Pulse card fits its own width, with its logo at every size Squashed from: * fix(clock): the Pulse card lays out by its own width, not the window's With the sidebar open, a ~780px window leaves the card ~500px: the window-based sm: row put the 288px pill and the logo beside the words and squeezed them into a ~80px column. The card is now an @container and goes side by side only from @2xl (~670px of its own); below that it stacks like the phone layout (words full width, pill under them). The plain Clock in / out pill keeps its window-based sizing (PULSE_ACTION_PILL vs MAIN_ACTION_PILL). Found by hand at ~780px; the responsive audit now sweeps 320-1460px in 60px steps (and the sidebar collapsed) and flags long text squeezed under 180px, which catches this card on the old code and passes on the new. * fix(clock): the Pulse card shows its logo at every size, the pill only its words The red Pulse logo was hidden whenever the card stacked (phones, and tablets with the sidebar open), and a second white logo sat inside the pill. Now the card's logo is always beside the words, vertically centred on them, and the "Clock in with Pulse" / "Clock out with Pulse" pill is text only (kept "with Pulse": the plain Clock in button is further down the same page). PulseLogo's `inverse` variant had no other use and is removed. * fix(clock): Clock in / out with Pulse is a plain primary button, like Post plan and clock in It was a large, fully rounded pill with a shadow and a hover scale (the page's Clock in style). It now matches the composer's "Post plan and clock in" / "Post wrap-up and clock out" button: default size, the library's corner radius, no shadow; full width while the card is stacked, its own width beside the words. The plain Clock in / out pill keeps its style. --- src/features/clock/ClockPage.tsx | 60 ++++++++++++++--------- src/features/pulse-upload/PulseButton.tsx | 7 ++- src/features/pulse-upload/PulseLogo.tsx | 12 +---- 3 files changed, 43 insertions(+), 36 deletions(-) diff --git a/src/features/clock/ClockPage.tsx b/src/features/clock/ClockPage.tsx index ab26456f3..f79d20f36 100644 --- a/src/features/clock/ClockPage.tsx +++ b/src/features/clock/ClockPage.tsx @@ -79,9 +79,15 @@ import { WorkspaceGreeting } from '../../ui/WorkspaceGreeting'; // ─── ClockPage ──────────────────────────────────────────────────────────────── -/** The page's main buttons — Clock in/out and Clock in/out with Pulse. */ +/** The page's main buttons — Clock in and Clock out. */ const MAIN_ACTION_PILL = 'w-full gap-3 rounded-full py-4 text-base font-semibold shadow-lg transition-transform hover:scale-[1.02] active:scale-95 sm:w-auto sm:min-w-72'; +/** + * Clock in / out with Pulse: styled like the composer's "Post plan and clock + * in" button (a plain primary button). Full width while the card is stacked, + * its own width once the card sits beside the words (see `clock-pulse`). + */ +const PULSE_ACTION_BUTTON = 'w-full @2xl:w-auto'; export const ClockPage: React.FC = () => { const { selectedTeamId, activeClockEvent, currentTime, teamsReady, refetchClock } = useTeam(); @@ -536,30 +542,40 @@ export const ClockPage: React.FC = () => { team requires a plan. Nothing typed in the composer below goes with it. ── */} {clockPulse && ( + // Laid out by the card's own width, not the window's: with the + // sidebar open a tablet-sized window leaves ~500px here, and a + // side-by-side card squeezed its words into a ~150px column beside + // the 288px pill. Side by side only from ~670px (@2xl).
- -
- - {isClockedIn ? 'Record your wrap-up' : 'Record your plan'} - - - {isClockedIn - ? "Sum up your session with the Pulse camera. Once it's uploaded, it's posted to Huddle and you're clocked out." - : "Say what you'll work on with the Pulse camera. Once it's uploaded, it's posted to Huddle and you're clocked in."} - - - Your Pulse draft's name becomes the post's text. - -
-
- +
+ {/* The Pulse logo is the card's, at every size (the pill has + none): beside the words, stacked or not. */} +
+ +
+ + {isClockedIn ? 'Record your wrap-up' : 'Record your plan'} + + + {isClockedIn + ? "Sum up your session with the Pulse camera. Once it's uploaded, it's posted to Huddle and you're clocked out." + : "Say what you'll work on with the Pulse camera. Once it's uploaded, it's posted to Huddle and you're clocked in."} + + + Your Pulse draft's name becomes the post's text. + +
+
+
+ +
)} diff --git a/src/features/pulse-upload/PulseButton.tsx b/src/features/pulse-upload/PulseButton.tsx index 646446d24..476eac161 100644 --- a/src/features/pulse-upload/PulseButton.tsx +++ b/src/features/pulse-upload/PulseButton.tsx @@ -26,8 +26,9 @@ interface PulseChipProps { /** What pressing it does, for screen readers: "Add a video with Pulse". */ ariaLabel: string; /** - * Where Pulse is the page's main way in (the Clock page), the page's primary - * pill with this label. Otherwise it's a "Pulse" chip like the ones beside it. + * Where Pulse is the page's main way in (the Clock page), a primary button + * with this label and no logo: the card around it carries the Pulse logo. + * Otherwise it's a "Pulse" chip like the ones beside it. */ main?: { label: string; className: string }; disabled?: boolean; @@ -78,8 +79,6 @@ export const PulseChip: React.FC = ({ ); }, diff --git a/src/features/pulse-upload/PulseButton.tsx b/src/features/pulse-upload/PulseButton.tsx index 476eac161..232c837b3 100644 --- a/src/features/pulse-upload/PulseButton.tsx +++ b/src/features/pulse-upload/PulseButton.tsx @@ -34,6 +34,14 @@ interface PulseChipProps { disabled?: boolean; /** Also offer "Upload": a video file from this device, sent to the same place. */ allowFile?: boolean; + /** + * The card layout (a Videos section): an upload's progress is the Upload + * button's own label ("Uploading 42%", "Processing…"), and errors and notes + * come before the buttons rather than after them. + */ + card?: boolean; + /** Below `sm`, the chips show only their icons (see ComposerChipButton `compact`). */ + compact?: boolean; } /** @@ -47,28 +55,39 @@ export const PulseChip: React.FC = ({ main, disabled, allowFile, + card, + compact, }) => { const { reserving, error, status, modalOpen, destination, progress, processing } = pulse; const fileInput = useRef(null); const sending = progress !== null || processing; + // A file on its way: said beside the chips, or (card) on the Upload button. + const inFlight = + progress !== null + ? `${card ? 'Uploading' : 'Uploading…'} ${Math.round(progress * 100)}%` + : processing + ? card + ? 'Processing…' + : 'Processing your video…' + : ''; // Phones have no modal: the same words the modal uses, beside the chip. A // landed video says nothing here — unless a step after delivery failed // (the plan posted but the clock-in didn't), which the note then says. - const note = - progress !== null - ? `Uploading… ${Math.round(progress * 100)}%` - : processing - ? 'Processing your video…' - : modalOpen - ? '' - : status?.state === 'kept' - ? keptMessage(status.reason) - : status?.state === 'expired' - ? EXPIRED_MESSAGE - : status?.state === 'done' - ? followUpNote(destination, status.note) - : ''; - const announced = !modalOpen && status?.state === 'done' ? landedLabel(destination) : ''; + const note = inFlight + ? card + ? '' + : inFlight + : modalOpen + ? '' + : status?.state === 'kept' + ? keptMessage(status.reason) + : status?.state === 'expired' + ? EXPIRED_MESSAGE + : status?.state === 'done' + ? followUpNote(destination, status.note) + : ''; + const announced = + (card && inFlight) || (!modalOpen && status?.state === 'done' ? landedLabel(destination) : ''); const shared = { onClick: () => void pulse.start(), disabled: disabled || reserving || sending, @@ -85,63 +104,79 @@ export const PulseChip: React.FC = ({ {reserving ? 'Opening Pulse…' : main.label} ) : ( - } {...shared}> + } compact={compact} {...shared}> Pulse ); - return ( + const chips = allowFile ? ( + + { + const file = e.target.files?.[0]; + e.target.value = ''; + if (file) void pulse.upload(file); + }} + /> + {pulseControl} + fileInput.current?.click()} + disabled={disabled || reserving || sending} + aria-busy={sending} + aria-label="Upload a video file" + leftIcon={ + sending ? ( + + ) : ( + + ) + } + > + {inFlight && card ? inFlight : 'Upload'} + + + ) : ( + pulseControl + ); + const errorText = error && ( + + {error} + + ); + // Mounted while there's a link, so the update is announced. + const statusText = (status || sending) && ( + + {note || announced} + + ); + // Card: messages come first, so they sit to the left of the buttons. + return card ? ( <> - {allowFile && ( - - { - const file = e.target.files?.[0]; - e.target.value = ''; - if (file) void pulse.upload(file); - }} - /> - {pulseControl} - fileInput.current?.click()} - disabled={disabled || reserving || sending} - aria-busy={sending} - aria-label="Upload a video file" - leftIcon={ - sending ? ( - - ) : ( - - ) - } - > - Upload - - - )} - {!allowFile && pulseControl} - - {error && ( - - {error} - - )} - {/* Mounted while there's a link, so the update is announced. */} - {(status || sending) && ( - - {note || announced} - - )} + {errorText} + {statusText} + {chips} + + ) : ( + <> + {chips} + {errorText} + {statusText} ); }; @@ -154,6 +189,15 @@ interface PulseButtonProps { disabled?: boolean; /** Also offer "Upload": a video file from this device, sent to the same place. */ allowFile?: boolean; + /** + * The card layout (see PulseChip `card`), with the buttons at the row's + * `end` (a section header) or `start`. Messages sit to the left of the + * buttons; where the row has no room for them (a phone) they wrap onto a + * line of their own under the buttons. + */ + card?: 'start' | 'end'; + /** Below `sm`, the chips show only their icons. */ + compact?: boolean; } export const PulseButton: React.FC = ({ @@ -162,11 +206,32 @@ export const PulseButton: React.FC = ({ onSettled, disabled, allowFile, + card, + compact, }) => { const pulse = usePulseUpload(destination, { onSettled }); return ( -
- +
+ { )} {pendingRequest && ( - <> + // One group: it moves under the title as a whole + // when it doesn't fit beside it, so the badge never + // ends up on a line apart from its Pulse and Upload. +
+ Pending approval - - +
)}
From de5f8c13e257e4526998551e3fc9f5bb9010d452 Mon Sep 17 00:00:00 2001 From: morepriyam Date: Mon, 26 Oct 2026 16:55:06 -0400 Subject: [PATCH 3/5] fix(pulse): Videos buttons wrap under their heading, and Clock's Pulse messages wrap under the button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Copilot review on PR 747: - The Videos header's Pulse · Upload group is never narrower than its buttons, so on a narrow screen (and with "Uploading 100%") they drop under "Videos" instead of being drawn over it. - Side by side, the Clock page's Pulse action column is capped at 18rem: a long error or follow-up note wraps under the button instead of widening the column into the card's words. --- src/features/clock/ClockPage.tsx | 5 ++++- src/features/pulse-upload/PulseButton.tsx | 9 ++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/features/clock/ClockPage.tsx b/src/features/clock/ClockPage.tsx index c6a062acb..4f07ae12c 100644 --- a/src/features/clock/ClockPage.tsx +++ b/src/features/clock/ClockPage.tsx @@ -612,7 +612,10 @@ export const ClockPage: React.FC = () => {
-
+ {/* Side by side, capped: a long error or follow-up note wraps + under the button instead of widening this column into the + words beside it. */} +
= ({ className={cn( 'pulse-upload flex items-center gap-2', // wrap-reverse: the buttons keep the first line, a message that - // doesn't fit beside them drops below. + // doesn't fit beside them drops below. No `min-w-0`: never narrower + // than the buttons, so a header too narrow for them wraps them under + // its heading instead of drawing them over it. card - ? cn( - 'min-w-0 flex-1 flex-wrap-reverse gap-y-1', - card === 'end' ? 'justify-end' : 'justify-start', - ) + ? cn('flex-1 flex-wrap-reverse gap-y-1', card === 'end' ? 'justify-end' : 'justify-start') : 'flex-wrap', )} > From 28dfc564d9a13c39fbc9ce60a15d4caa66b1d403 Mon Sep 17 00:00:00 2001 From: morepriyam Date: Tue, 27 Oct 2026 12:01:53 -0400 Subject: [PATCH 4/5] docs(clock): the compact pill's height note no longer depends on Pulse's button size --- src/features/clock/ClockPage.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/features/clock/ClockPage.tsx b/src/features/clock/ClockPage.tsx index f66bfc71a..3c96291d4 100644 --- a/src/features/clock/ClockPage.tsx +++ b/src/features/clock/ClockPage.tsx @@ -67,9 +67,8 @@ import { useRouter } from '../../ui/router'; /** The compact "X or Y" pair beside the plan/wrap-up input — the submit * button and the Pulse chip share this exact class list so the two read as * equal alternatives rather than a primary action and an afterthought. `h-10` - * is explicit because Pulse's chip is always rendered at Button `size="lg"` - * (h-12) internally — without overriding the height directly, matching - * padding alone still left it visibly taller than the plan/wrap-up button. */ + * is explicit so both stay the same height whatever Button size either one + * defaults to. */ const COMPACT_PILL = 'h-10 gap-2 rounded-full px-4 text-sm font-semibold shrink-0'; /** "or Clock in/out with Pulse" — beside every way this page clocks in or out. */ From ca30b1007eb09533a3fb765b2cf489910f636b30 Mon Sep 17 00:00:00 2001 From: morepriyam Date: Tue, 27 Oct 2026 12:08:31 -0400 Subject: [PATCH 5/5] fix(pulse): the Clock page's Pulse button keeps its logo Main's Clock page no longer has a Pulse card to carry the logo; Pulse is a compact button beside each clock action. So the button shows the white Pulse mark again, as it does on main. --- src/features/pulse-upload/PulseButton.tsx | 5 +++-- src/features/pulse-upload/PulseLogo.tsx | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/features/pulse-upload/PulseButton.tsx b/src/features/pulse-upload/PulseButton.tsx index 8601daf28..839e0c4f7 100644 --- a/src/features/pulse-upload/PulseButton.tsx +++ b/src/features/pulse-upload/PulseButton.tsx @@ -28,8 +28,8 @@ interface PulseChipProps { ariaLabel: string; /** * Where Pulse is the page's main way in (the Clock page), a primary button - * with this label and no logo: the card around it carries the Pulse logo. - * Otherwise it's a "Pulse" chip like the ones beside it. + * with the Pulse logo and this label. Otherwise it's a "Pulse" chip like the + * ones beside it. */ main?: { label: string; className: string }; disabled?: boolean; @@ -99,6 +99,7 @@ export const PulseChip: React.FC = ({