-
Notifications
You must be signed in to change notification settings - Fork 16
fix(walletkit): keep sign button visible for long dApp messages #963
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
Merged
JakeUrban
merged 4 commits into
stellar:main
from
SmolinPavel:fix/957-sign-message-button-long-message
Aug 4, 2026
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7a0dbb1
fix(walletkit): keep sign button visible for long dApp messages
SmolinPavel 97b07b7
fix(walletkit): raise sign_message size cap from 1KB to 10KB
SmolinPavel 98ae112
fix(walletkit): let the message box shrink when security warnings nee…
SmolinPavel 74c65dd
Merge branch 'main' into fix/957-sign-message-button-long-message
SmolinPavel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
__tests__/components/screens/WalletKit/DappMessageDisplay.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { DappMessageDisplay } from "components/screens/WalletKit/DappMessageDisplay"; | ||
| import { renderWithProviders } from "helpers/testUtils"; | ||
| import React from "react"; | ||
| import { Dimensions, StyleSheet } from "react-native"; | ||
|
|
||
| jest.mock("hooks/useAppTranslation", () => ({ | ||
| __esModule: true, | ||
| default: () => ({ t: (key: string) => key }), | ||
| })); | ||
|
|
||
| describe("DappMessageDisplay", () => { | ||
| it("renders the message content", () => { | ||
| const { getByTestId } = renderWithProviders( | ||
| <DappMessageDisplay message="hello world" />, | ||
| ); | ||
|
|
||
| expect(getByTestId("message-display-content")).toHaveTextContent( | ||
| "hello world", | ||
| ); | ||
| }); | ||
|
|
||
| it("pretty-prints JSON messages", () => { | ||
| const { getByTestId } = renderWithProviders( | ||
| <DappMessageDisplay message='{"a":1}' />, | ||
| ); | ||
|
|
||
| expect(getByTestId("message-display-content").props.children).toBe( | ||
| JSON.stringify({ a: 1 }, null, 2), | ||
| ); | ||
| }); | ||
|
|
||
| it("bounds the message scroll area so long messages cannot push the action buttons off-screen", () => { | ||
| const { getByTestId } = renderWithProviders( | ||
| <DappMessageDisplay message={"x".repeat(10000)} />, | ||
| ); | ||
|
|
||
| const scrollView = getByTestId("message-display-content-scroll"); | ||
| const style = StyleSheet.flatten(scrollView.props.style); | ||
|
|
||
| expect(style.maxHeight).toBeDefined(); | ||
| expect(style.maxHeight).toBeLessThanOrEqual( | ||
| Dimensions.get("window").height * 0.5, | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 98ae112. Rather than estimating per-state fixed content, the sheet content is now bounded to the usable window height (window minus safe-area insets and sheet chrome) and the message box gets
flexShrinkwith a 56pt minimum scroll window. The layout engine sizes the message from the space actually remaining, so the banner and stacked warning buttons squeeze the (scrollable) message instead of clipping the actions. The 30% cap remains as the upper bound on large screens.Converting the sheet to scrollable-with-pinned-footer was considered but rejected for this PR: all three request content types (
DappSignTransactionBottomSheetContent,DappSignAuthEntryBottomSheetContent, this one) embedDappRequestButtonsthemselves, so that refactor would restructure the sign-transaction flow as well — out of scope for this bug fix.