Skip to content

[Behind Time Tracking Beta] Allow editing hour count and rate in time expense confirmation page#79214

Merged
grgia merged 23 commits into
Expensify:mainfrom
software-mansion-labs:feat/time-confirmation-hours-rate-edit
Jan 19, 2026
Merged

[Behind Time Tracking Beta] Allow editing hour count and rate in time expense confirmation page#79214
grgia merged 23 commits into
Expensify:mainfrom
software-mansion-labs:feat/time-confirmation-hours-rate-edit

Conversation

@mhawryluk

@mhawryluk mhawryluk commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Hides the merchant row and adds 2 new ones (hours and rate) in the money request confirmation page, when creating a time request.

Fixed Issues

$ #77683
PROPOSAL: N/A

Tests

1, Log in to an account with timeTracking beta enabled.
2. Create a Workspace.
3. Enable Time Tracking feature for the workspace in Expensify Classic and set some default time tracking rate value there. (Settings > Workspaces > select the workspace > Time).
4. Go to the Workspace's chat/report in new dot.
5. Click the + button > Create expense.
6. Select the "Time" tab.
7. Enter a valid value for the input and click next, there should be a confirmation page
9. There should be no merchant row.
10. The amount row should not be clickable.
11. There should be a new "Hours" row, click on it.
12. Change the value, check if only correct values are accepted, click save.
13. The amount should be updated correctly (round(hours * rate)).
14. There should be a new "Rate" row, it should display the rate correctly formatted, click on it.
15. Change the hourly rate value and click save.
16. The amount should be updated correctly (round(hours * rate)).
17. Create the expense.
18. Check if the created expense has a correct merchant value (reflecting the modified count and rate).
19. Start creating a time expense again, set the hours and rate to very big numbers, try to create the expense, an error should be shown and creation shouldn't be allowed.

Offline tests

N/A

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Nagranie.z.ekranu.2026-01-12.o.14.21.43.mov
Android: mWeb Chrome
Nagranie.z.ekranu.2026-01-12.o.14.23.35.mov
iOS: Native
Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2026-01-12.at.13.58.04.mp4
iOS: mWeb Safari
Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2026-01-12.at.14.11.44.mp4
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-01-9.o.17.48.28.mov

@melvin-bot

melvin-bot Bot commented Jan 9, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Jan 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/SCREENS.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 75.00% <ø> (ø)
...es/iou/request/step/IOURequestStepConfirmation.tsx 55.91% <ø> (ø)
...iou/request/step/withFullTransactionOrNotFound.tsx 88.23% <ø> (ø)
.../iou/request/step/withWritableReportOrNotFound.tsx 86.36% <ø> (ø)
src/ROUTES.ts 12.71% <0.00%> (-0.13%) ⬇️
...gation/AppNavigator/ModalStackNavigators/index.tsx 8.07% <0.00%> (-0.03%) ⬇️
src/libs/TimeTrackingUtils.ts 0.00% <0.00%> (ø)
.../components/MoneyRequestConfirmationListFooter.tsx 84.32% <85.00%> (+0.24%) ⬆️
src/libs/actions/IOU/index.ts 67.74% <0.00%> (-0.06%) ⬇️
... and 3 more
... and 6 files with indirect coverage changes

@grgia grgia self-requested a review January 12, 2026 11:35
@github-actions

Copy link
Copy Markdown
Contributor

🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

This comment has been minimized.

@github-actions

This comment has been minimized.

@mhawryluk mhawryluk marked this pull request as ready for review January 13, 2026 13:24
@mhawryluk mhawryluk requested review from a team as code owners January 13, 2026 13:24
@melvin-bot melvin-bot Bot requested review from DylanDylann and JmillsExpensify and removed request for a team January 13, 2026 13:24
@melvin-bot

melvin-bot Bot commented Jan 13, 2026

Copy link
Copy Markdown

@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@mhawryluk mhawryluk changed the title Allow editing hour count and rate in time expense confirmation page [Behind Time Tracking Beta] Allow editing hour count and rate in time expense confirmation page Jan 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7bedff7025

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/pages/iou/request/step/IOURequestStepHours.tsx Outdated

@jnowakow jnowakow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@mhawryluk

Copy link
Copy Markdown
Contributor Author

yes, in this case the amount is invalid cause it is too high and it's definitely an edge case since the limit is very high.
so for the bottom of the confirmation page it would be something like: Amount is too large
and for the hours step maybe: Quantity too large for the current hourly rate. Maximum allowed: <max_amount/rate> ?

@mhawryluk

Copy link
Copy Markdown
Contributor Author

btw, this feature will be under beta for now and there will be more PRs coming soon, so we could change the error messages in one of them to not block this one, if we need more time to finalize the copy

@grgia

grgia commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

@dubielzyk-expensify @dannymcclain let's choose an error message for now while it's on our mind.

Maybe we should only error on the confirmation page:

The total amount is too large. Lower the hours or reduce the rate.

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

I like your suggestion @grgia 👍

@grgia grgia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! @mhawryluk would you update this PR with the above error message and let me know when you're ready for a final build 🙇

@mhawryluk

Copy link
Copy Markdown
Contributor Author

Cool! @mhawryluk would you update this PR with the above error message and let me know when you're ready for a final build 🙇

sure, on it!

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 4713b7d9..c340e4ed 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1507,6 +1507,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: 'Std.',
             hours: 'Stunden',
             ratePreview: (rate: string) => `${rate} / Stunde`,
+            amountTooLargeError: 'Der Gesamtbetrag ist zu hoch. Verringere die Stunden oder reduziere den Satz.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Erklären</strong></a> &#x2728;',
     },
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index e922d9d8..b8b738f9 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1508,6 +1508,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: 'h',
             hours: 'Heures',
             ratePreview: (rate: string) => `${rate} / heure`,
+            amountTooLargeError: 'Le montant total est trop élevé. Réduisez le nombre d’heures ou diminuez le tarif.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Expliquer</strong></a> &#x2728;',
     },
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 34977f37..ad6054e6 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1502,6 +1502,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: 'ore',
             hours: 'Ore',
             ratePreview: (rate: string) => `${rate} / ora`,
+            amountTooLargeError: 'L’importo totale è troppo elevato. Riduci le ore o diminuisci la tariffa.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Spiegare</strong></a> &#x2728;',
     },
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 8d12346d..8420fc47 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1501,6 +1501,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: '時間',
             hours: '時間',
             ratePreview: (rate: string) => `${rate} / 時間`,
+            amountTooLargeError: '合計金額が大きすぎます。時間を減らすか、レートを下げてください。',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>説明する</strong></a> &#x2728;',
     },
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 622d0123..ad6eeaa3 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1501,6 +1501,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: 'uur',
             hours: 'Uren',
             ratePreview: (rate: string) => `${rate} / uur`,
+            amountTooLargeError: 'Het totale bedrag is te hoog. Verlaag het aantal uren of verlaag het tarief.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Uitleggen</strong></a> &#x2728;',
     },
@@ -8008,7 +8009,6 @@ Hier is een *testbon* om je te laten zien hoe het werkt:`,
             confirm: 'Afstandstracking negeren',
         },
         zeroDistanceTripModal: {title: 'Kan geen uitgave aanmaken', prompt: 'Je kunt geen uitgave aanmaken met dezelfde begin- en eindlocatie.'},
-
         locationRequiredModal: {
             title: 'Locatietoegang vereist',
             prompt: 'Sta locatietoegang toe in de instellingen van je apparaat om GPS-afstandsregistratie te starten.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 0507d2c3..0d2af082 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1498,7 +1498,8 @@ const translations: TranslationDeepObject<typeof en> = {
             hoursAt: (hours: number, rate: string) => `${hours} ${hours === 1 ? 'godzina' : 'godziny'} @ ${rate} / godzinę`,
             hrs: 'godz.',
             hours: 'Godziny',
-            ratePreview: (rate: string) => `${rate} / godzinę`,
+            ratePreview: (rate: string) => `${rate} / godzina`,
+            amountTooLargeError: 'Całkowita kwota jest zbyt wysoka. Zmniejsz liczbę godzin lub obniż stawkę.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Wyjaśnij</strong></a> &#x2728;',
     },
@@ -7983,7 +7984,6 @@ Oto *paragon testowy*, który pokazuje, jak to działa:`,
             confirm: 'Odrzuć śledzenie dystansu',
         },
         zeroDistanceTripModal: {title: 'Nie można utworzyć wydatku', prompt: 'Nie możesz utworzyć wydatku z tym samym miejscem początkowym i końcowym.'},
-
         locationRequiredModal: {
             title: 'Wymagany dostęp do lokalizacji',
             prompt: 'Aby rozpocząć śledzenie dystansu GPS, zezwól na dostęp do lokalizacji w ustawieniach swojego urządzenia.',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index beae2769..690925a3 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1498,6 +1498,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: 'h',
             hours: 'Horas',
             ratePreview: (rate: string) => `${rate} / hora`,
+            amountTooLargeError: 'O valor total é muito alto. Reduza as horas ou diminua a tarifa.',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>Explicar</strong></a> &#x2728;',
     },
@@ -7993,7 +7994,6 @@ Aqui está um *recibo de teste* para mostrar como funciona:`,
             confirm: 'Descartar rastreamento de distância',
         },
         zeroDistanceTripModal: {title: 'Não é possível criar a despesa', prompt: 'Você não pode criar uma despesa com o mesmo local de partida e de chegada.'},
-
         locationRequiredModal: {
             title: 'Acesso à localização necessário',
             prompt: 'Permita o acesso à localização nas configurações do seu dispositivo para iniciar o rastreamento de distância por GPS.',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index a7fff3e7..ecd0749e 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1476,6 +1476,7 @@ const translations: TranslationDeepObject<typeof en> = {
             hrs: '小时',
             hours: '小时',
             ratePreview: (rate: string) => `${rate} / 小时`,
+            amountTooLargeError: '总金额过大。请减少工时或降低费率。',
         },
         AskToExplain: '. <a href="new-expensify://concierge/explain"><strong>解释</strong></a> &#x2728;',
     },
@@ -7799,7 +7800,6 @@ ${reportName}
         stopGpsTrackingModal: {title: '停止 GPS 追踪', prompt: '你确定吗?这将结束你当前的旅程。', cancel: '恢复追踪', confirm: '停止 GPS 追踪'},
         discardDistanceTrackingModal: {title: '丢弃距离跟踪', prompt: '您确定吗?这将放弃您当前的流程,且无法撤销。', confirm: '丢弃距离跟踪'},
         zeroDistanceTripModal: {title: '无法创建报销', prompt: '你不能创建起点和终点相同的报销。'},
-
         locationRequiredModal: {title: '需要访问位置信息', prompt: '请在设备设置中允许位置访问以开始 GPS 距离跟踪。', allow: '允许'},
         androidBackgroundLocationRequiredModal: {title: '需要后台位置访问权限', prompt: '请在设备设置中允许应用使用“始终允许”位置访问权限,以开始 GPS 距离跟踪。'},
         preciseLocationRequiredModal: {title: '需要精确位置', prompt: '请在设备设置中启用“精确位置”以开始 GPS 距离跟踪。'},

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

@mhawryluk mhawryluk requested a review from grgia January 16, 2026 12:41
@mhawryluk

Copy link
Copy Markdown
Contributor Author

@grgia the PR is ready!

@github-actions

Copy link
Copy Markdown
Contributor

🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here.

@grgia grgia requested a review from DylanDylann January 16, 2026 16:53

@grgia grgia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, going to test manually before merge.

cc @DylanDylann for final review as well 🎉

@github-actions

Copy link
Copy Markdown
Contributor

@DylanDylann DylanDylann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@melvin-bot melvin-bot Bot requested a review from grgia January 19, 2026 03:33
@grgia grgia merged commit 8e492ef into Expensify:main Jan 19, 2026
30 checks passed
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/grgia in version: 9.3.5-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.3.5-7 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants