Skip to content
Merged
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
16 changes: 9 additions & 7 deletions release-notes/1.0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,21 @@ message saying so — straight away, not after several tries.

## A walkthrough for a timesheet change, recorded or uploaded

When a change to your timesheet waits for approval, **Walkthrough** with
**Pulse** and **Upload** sits beside _Pending approval_. Record a short
walkthrough of the change, or upload one, and it's added to the request as
soon as it uploads, so your approver sees it alongside your explanation. You
can also attach one while you write the change, under the same name.
When a change to your timesheet waits for approval, two buttons sit beside
_Pending approval_: the Pulse logo to record a walkthrough on your phone, and
the upload arrow for a video you already have. The walkthrough is added to the
request as soon as it uploads, so your approver sees it alongside your
explanation. You can also attach one while you write the change.

## Pulse fits every screen

Every place Pulse appears was checked on a phone, a tablet, a laptop and a wide
screen. On a phone your timesheet keeps each session's buttons in view while
the table scrolls, and a pending change's walkthrough gets a line of its own;
on the Work page the walkthrough moves under the entry instead of being cut
off. The Pulse window fits a phone held sideways, and **Approve** is no longer
cut short when reviewing a change.
off. While a video uploads, its progress shows on the **Upload** button itself.
The Pulse window fits a phone held sideways, and **Approve** is no longer cut
short when reviewing a change.

## Pull requests in this release

Expand All @@ -184,3 +185,4 @@ cut short when reviewing a change.
- Ticket names on Huddle posts link to the ticket ([#751](https://github.com/mieweb/timehuddle/pull/751))
- Upload beside Pulse, and uploaded videos converted to the Pulse format when they can be ([#746](https://github.com/mieweb/timehuddle/pull/746))
- Links go in the text, and Videos on every ticket and clock session ([#746](https://github.com/mieweb/timehuddle/pull/746))
- A pending change and an upload's progress fit every screen ([#747](https://github.com/mieweb/timehuddle/pull/747))
10 changes: 6 additions & 4 deletions src/features/clock/AttachmentsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ export const AttachmentsPanel: React.FC<AttachmentsPanelProps> = ({

return (
<section className="attachments-panel">
{/* Wraps instead of squeezing: on a phone the chips (and the upload's
status line beside them) drop under the heading. */}
<div className="attachments-header mb-3 flex flex-wrap items-center justify-between gap-x-3 gap-y-2">
{/* Wraps instead of squeezing: on a phone the chips drop under the
heading. Top-aligned: a message that doesn't fit beside the chips
drops under them, and the heading stays level with the chips. */}
<div className="attachments-header mb-3 flex flex-wrap items-start justify-between gap-x-3 gap-y-2">
{showHeading && (
<Text
as="h3"
size="sm"
className="flex items-center gap-1.5 font-semibold text-neutral-700 dark:text-neutral-300"
className="flex min-h-8 items-center gap-1.5 font-semibold text-neutral-700 dark:text-neutral-300"
>
<FontAwesomeIcon icon={faVideo} size="sm" aria-hidden />
Videos
Expand All @@ -85,6 +86,7 @@ export const AttachmentsPanel: React.FC<AttachmentsPanelProps> = ({
destination={{ kind, id: entityId }}
ariaLabel="Add a video with Pulse"
allowFile
card={showHeading ? 'end' : 'start'}
onSettled={(status) => status.state === 'done' && void fetchAttachments()}
/>
</div>
Expand Down
13 changes: 6 additions & 7 deletions src/features/clock/ChangeRequestWalkthrough.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* to its destination when it lands, and the request doesn't exist until it's
* submitted. Once it lands the approver sees it in Timesheet Approvals.
*/
import { Badge, Text } from '@mieweb/ui';
import { Badge } from '@mieweb/ui';
import React from 'react';

import type { TimesheetChangeRequest } from '../../lib/api';
Expand Down Expand Up @@ -67,15 +67,14 @@ const WalkthroughUpload: React.FC<{
},
},
);
// Named like the form's "Walkthrough" field, so both read as the same thing.
// Pulse and Upload, before "Pending approval" (icons only on a phone).
// `contents`: they join the host's own row, so they line up with the badge
// on one line, wrapping where there's no room.
return (
<>
{children(
<div className="change-request-walkthrough flex flex-wrap items-center gap-x-2 gap-y-1">
<Text as="span" size="xs" variant="muted">
Walkthrough
</Text>
<PulseControls pulse={pulse} ariaLabel="Add a walkthrough with Pulse" allowFile />
<div className="change-request-walkthrough contents">
<PulseControls pulse={pulse} ariaLabel="Add a walkthrough with Pulse" allowFile compact />
</div>,
)}
</>
Expand Down
5 changes: 2 additions & 3 deletions src/features/clock/ClockPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
10 changes: 6 additions & 4 deletions src/features/clock/TimesheetRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ interface Props {
changeStatus?: 'pending' | 'rejected';
/** The reviewer's reason, shown on a declined change. */
changeNote?: string;
/** Shown beside "Pending approval" on the session's first row: the walkthrough control. */
/** Shown before "Pending approval" on the session's first row: the walkthrough's Pulse and Upload. */
pendingAction?: React.ReactNode;
}

Expand Down Expand Up @@ -319,15 +319,16 @@ export const TimesheetRow: React.FC<Props> = ({
<TableCell>{showTeam ? teamName : ''}</TableCell>
<TableCell>
{row.isContinued ? null : changeStatus === 'pending' ? (
<div className="pending-approval-status flex flex-wrap items-center gap-2">
<div className="pending-approval-status flex flex-wrap items-center gap-2 lg:flex-nowrap">
{showActions && !walkthroughOwnLine && pendingAction}
<Badge
variant="warning"
className="shrink-0 whitespace-nowrap"
size="sm"
title="Waiting for an admin to approve your change"
>
Pending approval
</Badge>
{showActions && !walkthroughOwnLine && pendingAction}
</div>
) : changeStatus === 'rejected' ? (
// The reviewer's note is shown, not hidden in a tooltip: a
Expand Down Expand Up @@ -399,14 +400,15 @@ export const TimesheetRow: React.FC<Props> = ({
its padding, and less the sidebar from md up) so it wraps
there instead of running past the edge. */}
<div className="sticky start-0 flex w-fit max-w-[calc(100vw-3.5rem)] flex-wrap items-center gap-2 md:max-w-[calc(100vw-18.5rem)]">
{pendingAction}
<Badge
variant="warning"
className="shrink-0 whitespace-nowrap"
size="sm"
title="Waiting for an admin to approve your change"
>
Pending approval
</Badge>
{pendingAction}
</div>
</TableCell>
</TableRow>
Expand Down
18 changes: 14 additions & 4 deletions src/features/huddle/ComposerChipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* `ghost` plus the border below is that reconciliation, in one place. If
* @mieweb/ui gains a neutral outline variant, this collapses to it.
*/
import { Button } from '@mieweb/ui';
import { Button, cn } from '@mieweb/ui';
import { forwardRef, type ReactElement, type ReactNode } from 'react';

interface ComposerChipButtonProps {
Expand All @@ -28,10 +28,15 @@ interface ComposerChipButtonProps {
'aria-expanded'?: boolean;
/** Only where the visible label isn't already a sufficient accessible name. */
'aria-label'?: string;
/**
* Below `sm`, just the icon in a circle: the label is kept for screen
* readers only, so a row of chips fits a phone.
*/
compact?: boolean;
}

export const ComposerChipButton = forwardRef<HTMLButtonElement, ComposerChipButtonProps>(
function ComposerChipButton({ children, leftIcon, onClick, disabled, ...aria }, ref) {
function ComposerChipButton({ children, leftIcon, onClick, disabled, compact, ...aria }, ref) {
return (
<Button
ref={ref}
Expand All @@ -41,10 +46,15 @@ export const ComposerChipButton = forwardRef<HTMLButtonElement, ComposerChipButt
onClick={onClick}
disabled={disabled}
leftIcon={leftIcon}
className="gap-1.5 rounded-full border border-gray-200 px-3 py-1.5 text-xs font-normal text-gray-500 hover:bg-gray-50 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700"
className={cn(
'gap-1.5 rounded-full border border-gray-200 px-3 py-1.5 text-xs font-normal text-gray-500 hover:bg-gray-50 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700',
// No gap below sm: the hidden label would still hold one, pushing
// the icon off centre.
compact && 'max-sm:size-8 max-sm:shrink-0 max-sm:justify-center max-sm:gap-0 max-sm:p-0',
)}
{...aria}
>
{children}
{compact ? <span className="max-sm:sr-only">{children}</span> : children}
</Button>
);
},
Expand Down
Loading
Loading