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(mobile): FW update changelog modal #16205

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Conversation

Nodonisko
Copy link
Contributor

@Nodonisko Nodonisko commented Jan 6, 2025

Description

Implement changelog bottom sheet + fix centering of Confirm on Trezor image on bottom of screen.

Related Issue

Resolve part of #15584
Resolve #16572

Screenshots:

Screenshot_20250106-150905

@Nodonisko Nodonisko requested a review from a team as a code owner January 6, 2025 14:43
@Nodonisko Nodonisko added the mobile Suite Lite issues and PRs label Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 23
  • More info

Learn more about 𝝠 Expo Github Action

@Nodonisko Nodonisko changed the title fix(mobile): confirm on trezor image correctly centered feat(mobile): FW update changelog modal Jan 6, 2025
@Nodonisko Nodonisko force-pushed the feat/fw-changelog branch 2 times, most recently from a66536a to b95f79c Compare January 23, 2025 17:08
@PeKne PeKne added the release-native Has to be included in the upcoming release. label Jan 24, 2025

let formattedText = text;

if (text.startsWith(' - ')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you might want to do the same for '*' since it looks like this otherwise:
image

}

if (typeof firmwareChangelog === 'string') {
return <Text>{firmwareChangelog}</Text>;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that formatting may also be used in this case.

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 went though changelogs in trezor/data repo and I haven't seen any single occurence of formatting so I won't be doing now, in future we may need to use full fledged markdown library, but for now it looks like overkill to me.

const key = text + index;

if (text.startsWith('#')) {
const strippedText = text.replaceAll('#', '').trim();
Copy link
Contributor

Choose a reason for hiding this comment

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

In case the # symbol is somewhere in the text, it'll be remove as well.

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 made whole parser more robust using regexp so it should work correctly.

@PeKne PeKne removed the release-native Has to be included in the upcoming release. label Jan 24, 2025
Copy link
Member

@matejkriz matejkriz left a comment

Choose a reason for hiding this comment

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

The text alignment on the line break is not perfect, but I would consider it a nitpick and I don't believe it's worth fixing now. I think we might consider the full Markdown support later together with the decoupling of the FW release from the Suite release (fetching releases.json remotely).

image

@Nodonisko Nodonisko merged commit 313c85a into develop Jan 30, 2025
33 of 35 checks passed
@Nodonisko Nodonisko deleted the feat/fw-changelog branch January 30, 2025 12:40
@STew790
Copy link
Contributor

STew790 commented Feb 6, 2025

QA OK
LGTM
image

Info
25.1.3 dde03ca

@STew790 STew790 added the QA OK Issue passed QA without any blocker label Feb 6, 2025
Copy link

coderabbitai bot commented Feb 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces a new selector function, selectFirmwareChangelog, in the device reducer to retrieve the appropriate firmware changelog based on whether the device uses Bitcoin-only firmware. It adds new localizable strings in the firmware update screen, detailing button labels, titles, and messages for cases where the changelog is unavailable. Two new React components—FirmwareChangelog and FirmwareChangelogButton—are implemented. The FirmwareChangelog component renders the changelog in a bottom sheet interface, while the FirmwareChangelogButton handles user interaction to display the changelog. Finally, the firmware update screen is updated to incorporate the new button and adjust layout spacing.

Assessment against linked issues

Objective Addressed Explanation
Firmware update changelog is not showing (#16572)

Possibly related PRs

Suggested reviewers

  • Nodonisko
  • MiroslavProchazka
  • komret

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c602de and 0d21789.

📒 Files selected for processing (5)
  • suite-common/wallet-core/src/device/deviceReducer.ts (1 hunks)
  • suite-native/intl/src/en.ts (1 hunks)
  • suite-native/module-device-settings/src/screens/FirmwareUpdateScreen/FirmwareChangelog.tsx (1 hunks)
  • suite-native/module-device-settings/src/screens/FirmwareUpdateScreen/FirmwareChangelogButton.tsx (1 hunks)
  • suite-native/module-device-settings/src/screens/FirmwareUpdateScreen/FirmwareUpdateScreen.tsx (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs QA OK Issue passed QA without any blocker
Projects
Status: ✅ Approved
Development

Successfully merging this pull request may close these issues.

Firmware update changelog is not showing
6 participants