From 4f679981713e733234e7c96521c0e42757705cd0 Mon Sep 17 00:00:00 2001 From: Aditya Khatri Date: Thu, 29 Jan 2026 17:13:47 +0545 Subject: [PATCH] fix(work-item): fix work item expansion for ios devices by controlling clicks --- .github/workflows/ci.yml | 2 +- docker-compose.yml | 2 +- src/index.css | 2 - .../DayView/WorkItemRow/index.tsx | 186 +++++++++++------- .../DayView/WorkItemRow/styles.module.css | 25 +-- src/views/DailyJournal/DayView/index.tsx | 4 + .../DailyJournal/DayView/styles.module.css | 2 +- 7 files changed, 127 insertions(+), 96 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 554a1be..73e0c81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,12 +8,12 @@ on: env: APP_TITLE: Timur - APP_ENVIRONMENT: testing APP_GRAPHQL_CODEGEN_ENDPOINT: ./backend/schema.graphql APP_GRAPHQL_DOMAIN: https://timur-fake-endpoint.com APP_UMAMI_SRC: https://umami-fake-endpoint.com/script.js APP_UMAMI_ID: fake-umami-id APP_SENTRY_DSN: htts://dsn-fake@sentry.com/9999 + APP_ENVIRONMENT: testing GITHUB_WORKFLOW: true jobs: diff --git a/docker-compose.yml b/docker-compose.yml index 2b3c9af..45c1eb3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,4 +16,4 @@ services: volumes: - ../:/code ports: - - 127.0.0.1:3000:3000 + - 0.0.0.0:3000:3000 diff --git a/src/index.css b/src/index.css index acb3396..c8b5e0e 100644 --- a/src/index.css +++ b/src/index.css @@ -34,8 +34,6 @@ --font-size-4xl: calc(var(--base-font-size) * 3.6); /* 2.5 */ @media screen and (max-width: 40rem) { - --base-font-size: 0.875rem; - --font-size-2xs: calc(var(--base-font-size) * 0.75); --font-size-xs: calc(var(--base-font-size) * 0.875); --font-size-sm: calc(var(--base-font-size) * 0.9375); diff --git a/src/views/DailyJournal/DayView/WorkItemRow/index.tsx b/src/views/DailyJournal/DayView/WorkItemRow/index.tsx index 7a0c752..17fb9b4 100644 --- a/src/views/DailyJournal/DayView/WorkItemRow/index.tsx +++ b/src/views/DailyJournal/DayView/WorkItemRow/index.tsx @@ -1,16 +1,19 @@ import { useCallback, useContext, + useEffect, useMemo, + useRef, useState, } from 'react'; import { RiDeleteBin2Line, - RiEditBoxLine, RiFileCopyLine, - RiMoreLine, - RiSwap2Line, } from 'react-icons/ri'; +import { + TbCalendarPlus, + TbCalendarRepeat, +} from 'react-icons/tb'; import { _cs, isDefined, @@ -19,9 +22,8 @@ import { import Button from '#components/Button'; import Checkbox from '#components/Checkbox'; +import ConfirmButton from '#components/ConfirmButton'; import Dialog from '#components/Dialog'; -import DropdownMenu from '#components/DropdownMenu'; -import DropdownMenuItem from '#components/DropdownMenuItem'; import DurationInput from '#components/DurationInput'; import MonthlyCalendar from '#components/MonthlyCalendar'; import SelectInput from '#components/SelectInput'; @@ -45,6 +47,9 @@ import styles from './styles.module.css'; type WorkItemTypeOption = EnumsQuery['enums']['TimeEntryType'][number]; type WorkItemStatusOption = EnumsQuery['enums']['TimeEntryStatus'][number]; +// eslint-disable-next-line @typescript-eslint/no-empty-function +const noOp = () => {}; + function taskKeySelector(item: Task) { return item.id; } @@ -84,6 +89,8 @@ interface Props { workItem: WorkItem; tasks: Task[] | undefined; contractId: string | undefined; + isExpanded?: boolean; + onToggleExpand?: (clientId: string | undefined) => void; onClone?: (clientId: string, override?: Partial) => void; onChange?: (clientId: string, ...entries: EntriesAsList) => void; @@ -96,6 +103,8 @@ function WorkItemRow(props: Props) { workItem, tasks, contractId, + isExpanded = false, + onToggleExpand, onClone, onDelete, onChange, @@ -105,6 +114,7 @@ function WorkItemRow(props: Props) { const { screen } = useContext(SizeContext); const inputRef = useFocusClient(workItem.clientId); + const rowRef = useRef(null); const [config] = useLocalStorage('timur-config'); const setFieldValue = useCallback( @@ -188,6 +198,12 @@ function WorkItemRow(props: Props) { [onClone, workItem.clientId], ); + const handleToggleExpand = useCallback(() => { + if (screen !== 'desktop' && onToggleExpand) { + onToggleExpand(workItem.clientId); + } + }, [screen, onToggleExpand, workItem.clientId]); + const statusInput = config.checkboxForStatus ? ( +
+