Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(llm): πŸ₯… display human readable errors when the send flow fails #8081

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

thesan
Copy link
Contributor

@thesan thesan commented Oct 11, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

πŸ“ Description

Display human readable errors when the send flow fails.

image
NodeErrors.mov

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 8:36am
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 8:36am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 8:36am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 8:36am
web-tools ⬜️ Ignored (Inspect) Visit Preview Oct 18, 2024 8:36am

@live-github-bot live-github-bot bot added mobile Has changes in LLM common Has changes in live-common translations Translation files have been touched labels Oct 11, 2024
@thesan thesan force-pushed the feat/send-flow-better-node-errors branch from 049e4e3 to 1a07f79 Compare October 16, 2024 16:09
@thesan thesan changed the title πŸ₯…(llm): show better send flow node errors πŸ₯…(llm): display human readable errors when the send flow fails Oct 16, 2024
@thesan thesan changed the title πŸ₯…(llm): display human readable errors when the send flow fails feat(llm): πŸ₯… display human readable errors when the send flow fails Oct 16, 2024
setTimeout(() => (transition.value = withTiming(0, { duration: 200 })), 1200);
}, [text, transition]);

const copyIconAnimation = useAnimatedStyle(() => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could add a toast as it's done with receive copy wdyt ? I think it is a common approach for mobile

      pushToast({
        id: `copy-receive`,
        type: "success",
        icon: "success",
        title: t("transfer.receive.addressCopied"), // replace it
      });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried the toast but it blocks the cta with a tiny closing button and it doesn't follow the user theme AFAICS (white bg on a dark theme). So I kept the subtle same feedback for now.

alignItems="flex-start"
rowGap={16}
>
<Text numberOfLines={3} variant="paragraphLineHeight">
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure that's fitting for help center I think the message should be fully visible even if it's more than 3 lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

);
}

const InformativeBannerButton = styled(Button).attrs({
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure since it's from the lib but can't we add an active css so the button gets a little white ? (it's done on some buttons of llm but not all of them so it's just an idea not sure that's useful)

Copy link
Contributor Author

@thesan thesan Oct 17, 2024

Choose a reason for hiding this comment

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

I realized that the active style was disabled on the Button component from the DS (it's not the case for quick action buttons and promisables). Here's the commit but I don't have the PR it was part of (this is why I sometime prefer squashing: it removes data in the git repo but makes the GH data easier to find). So I kept the change but made it overidable to hopefully not break anything 🀞.

@cgrellard-ledger do you remember the context of this change ☝️ ?

import useExportLogs from "~/components/useExportLogs";
import { ScreenName } from "~/const";
import Collapsible from "~/newArch/components/Collapsible";
import CopyButton from "~/newArch/components/CopyButton";
Copy link
Contributor

Choose a reason for hiding this comment

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

You can replace ~/newArch by LLM/ if you want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good to know πŸ‘

<Copy />
</Animated.View>
<Animated.View style={[checkIconAnimation, checkIconStyle]}>
<Check />
Copy link
Contributor

@LucasWerey LucasWerey Oct 17, 2024

Choose a reason for hiding this comment

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

Maybe use Icons.Check instead of importing the icon directly and change the colour to green ?(as you feel)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I imported Icons instead of each icon individualy. I'll keep that in mind in the future.
For the color green it felt a bit too flashy compare to the rest of the UI IMO.

@live-github-bot live-github-bot bot added the ui Has changes in the design system library label Oct 17, 2024
@thesan
Copy link
Contributor Author

thesan commented Oct 17, 2024

@LucasWerey I just saw that I had forgotten to actualy show the network and coin in the error message. To fix that I had to make some major changes in the createTransactionBroadcastError

message.includes("-25: bad-tnxs-inputs-missingorspent") ||
message.includes("-25: Missing inputs")
) {
return "https://support.ledger.com/article/5129526865821-zd";
Copy link
Contributor

Choose a reason for hiding this comment

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

You should move this outside :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common mobile Has changes in LLM translations Translation files have been touched ui Has changes in the design system library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants