Skip to content

Conversation

@MayaRainer
Copy link
Member

@MayaRainer MayaRainer commented Nov 5, 2025

Closes #1502.

Removes the interstitial modal when clicking on an invoice row, instead taking the user to the invoice page directly.

Before

Screencast_20251105_173455.webm

After

Screencast_20251105_182918.webm

@MayaRainer MayaRainer marked this pull request as ready for review November 5, 2025 19:55
Copy link
Member Author

@MayaRainer MayaRainer left a comment

Choose a reason for hiding this comment

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

@slavingia / @laugardie lmkwyt! test failures are on main as well

await invoiceRow.click();

await expect(page.getByRole("dialog")).toBeVisible();
await page.getByRole("row").filter({ hasText: "Awaiting approval" }).click();
Copy link
Member Author

Choose a reason for hiding this comment

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

Just simplified this a little bit.

await page.getByRole("row").getByText("Awaiting approval").first().click();
await page.getByRole("row").filter({ hasText: "Awaiting approval" }).click();

await expect(page.getByRole("heading", { name: "INV-123456" })).toBeVisible();
Copy link
Member Author

Choose a reason for hiding this comment

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

Asserting that the new page is visible rather than a modal.

}
};

const [rowSelection, setRowSelection] = useState<Record<string, boolean>>(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

To preserve the row selection when coming back from the detail page.

await login(page, preOnboardingUser, `/invoices/${invoice.externalId}`);
await expect(page.getByText("Missing tax information.")).toBeVisible();
await page.getByRole("link", { name: "Invoices" }).click();
await page.getByRole("link", { name: "Invoices", exact: true }).click();
Copy link
Member Author

Choose a reason for hiding this comment

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

To disambiguate from the "Back to invoices" link

@laugardie
Copy link
Contributor

We could probably remove “View invoice” from the contextual menu since the row is now clickable to open it.Screenshot 2025-11-06 at 11 49 48

Also, when testing on mobile, I am not able to navigate to the invoice page.

Screen.Recording.2025-11-06.at.11.52.07.mov

Copy link
Member Author

@MayaRainer MayaRainer left a comment

Choose a reason for hiding this comment

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

@laugardie _a Thanks! Could you have another look please?

@laugardie
Copy link
Contributor

@MayaRainer _a looks good to me!

@neetogit-bot neetogit-bot bot assigned MayaRainer and unassigned laugardie Nov 7, 2025
@MayaRainer
Copy link
Member Author

@laugardie Thanks!
@slavingia _a lmk if this is good to merge!

@neetogit-bot neetogit-bot bot assigned slavingia and unassigned MayaRainer Nov 7, 2025
Copy link
Member Author

@MayaRainer MayaRainer left a comment

Choose a reason for hiding this comment

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

Added the new invoice totals UI - @ershad @laugardie lmkwyt!

Before

image image image

After

image image image

await page.getByPlaceholder("Description").first().fill("first item updated");
await fillByLabel(page, "Hours / Qty", "04:30", { index: 0 });
await expect(page.getByText("$870", { exact: true })).toBeVisible();
await Promise.all([
Copy link
Member Author

Choose a reason for hiding this comment

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

These checks were unnecessary and making the test flaky.

</div>
) : null}
{company.equityEnabled ? (
<Totals
Copy link
Member Author

Choose a reason for hiding this comment

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

Made a component to share between the edit and show page as they're so similar now.

@laugardie
Copy link
Contributor

@MayaRainer just pushed some small UI changes. Rest looks good to me!

I have one small concern regarding the UX when editing the equity (not strictly an issue with this PR, but related). If a contractor adds line items to a new invoice and then realizes they need to update the payment split, clicking that link navigates them away and they lose all the data they just entered. Even if open on a new tab, we need to reload to get the updated equity split.
I'm thinking maybe we could just save the form progress temporarily? Keep the info while the invoice hasn't been sent, and then clear it out once they successfully hit send? @ershad

Copy link
Member Author

@MayaRainer MayaRainer left a comment

Choose a reason for hiding this comment

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

maybe we could just save the form progress temporarily

Makes sense to me! Happy to make that change in a follow-up if we want to.

@ershad Good to merge?

},
expect: { timeout: 30000, toPass: { timeout: 30000 } },
timeout: process.env.CI ? 30000 : 120000,
timeout: process.env.CI ? 60000 : 120000,
Copy link
Member Author

Choose a reason for hiding this comment

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

Increased this to 60s as the complete-flow spec is just so long that it sometimes can't complete within 30s. The expect timeout remains 30s, so any actually failing assertions will still fail after 30s.

Copy link
Member

@ershad ershad left a comment

Choose a reason for hiding this comment

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

@MayaRainer _a added a couple of comments, lgtm otherwise 👍🏼

expensesTotal={invoice.expenses.reduce((acc, expense) => acc + expense.totalAmountInCents, BigInt(0))}
equityAmountInCents={invoice.equityAmountInCents}
equityNotice={
invoice.equityAmountInCents > 0 ? (
Copy link
Member

Choose a reason for hiding this comment

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

@MayaRainer just checked with @slavingia, for companies that have equity enabled, can we display the equity split and percentage even if it's 0?

for company equity.
</span>{" "}
<Link href="/settings/payouts" className={linkClasses}>
Edit
Copy link
Member

Choose a reason for hiding this comment

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

Can we hide the link until we have a system to either save progress or automatically update the invoice numbers when the split is updated in settings?

@neetogit-bot neetogit-bot bot assigned MayaRainer and unassigned slavingia Dec 16, 2025
Copy link
Member Author

@MayaRainer MayaRainer left a comment

Choose a reason for hiding this comment

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

@ershad _a Thanks! Done and done, could you have another look please? Test failures look unrelated.

@neetogit-bot neetogit-bot bot assigned ershad and unassigned MayaRainer Dec 19, 2025
@MayaRainer
Copy link
Member Author

@ershad Gentle bump on this when you have a moment :)

Copy link
Member

@ershad ershad left a comment

Choose a reason for hiding this comment

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

@MayaRainer added one comment, lgtm otherwise 👍🏼

Wasn't able to test with an equity invoice since the seed data doesn't include it. But it should be okay since tests cover that.

</PrintTableHeader>
<PrintTableHeader className="w-[20%] text-right md:w-[15%] print:text-right">
Cash rate
Rate
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this Rate on web and Cash rate on print view?

@MayaRainer MayaRainer merged commit c5f4dbb into main Dec 26, 2025
3 of 4 checks passed
@MayaRainer MayaRainer deleted the remove-invoice-interstitial branch December 26, 2025 21:45
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.

Remove invoice interstitial

5 participants