-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Bugfix/report preview jumping #72302
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
tgolen
merged 13 commits into
Expensify:main
from
callstack-internal:bugfix/report-preview-jumping
Oct 21, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2035c46
fix: report preview jumping
kstroz 1813a91
bugfix: code cleanup
kstroz 49f0266
bugfix: cleanup
kstroz bc65912
Merge branch 'main' into bugfix/report-preview-jumping
kstroz fab45c5
bugfix: logs
kstroz e5b7aba
bugfix: remove logs
kstroz f81e361
Merge branch 'main' into bugfix/report-preview-jumping
kstroz 941d03a
bugfix: include deeplink in maintainVisibleContentPosition condition
kstroz 974dbfa
Merge branch 'main' into bugfix/report-preview-jumping
kstroz 7f70bcf
bugfix: added dummy test
kstroz 9a06668
fix: RenderTaskQueue test
kstroz c896ca7
Merge branch 'main' into bugfix/report-preview-jumping
kstroz ce667bf
bugfix: added comments, naming cleanup
kstroz 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
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
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
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,51 @@ | ||
| import RenderTaskQueue from '../../src/components/InvertedFlatList/BaseInvertedFlatList/RenderTaskQueue'; | ||
|
|
||
| jest.unmock('../../src/components/InvertedFlatList/BaseInvertedFlatList/RenderTaskQueue'); | ||
|
|
||
| describe('RenderTaskQueue', () => { | ||
| beforeEach(() => { | ||
| jest.useFakeTimers(); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| jest.clearAllTimers(); | ||
| jest.useRealTimers(); | ||
| }); | ||
|
|
||
| describe('notifyRenderingStateChange callback', () => { | ||
| it('should notify rendering state changes when a task completes naturally to track the rendering lifecycle', () => { | ||
| // Given a RenderTaskQueue with an isRendering change callback | ||
| const mockOnIsRenderingChange = jest.fn(); | ||
| const queue = new RenderTaskQueue(mockOnIsRenderingChange); | ||
|
|
||
| // When a task is added and allowed to complete | ||
| queue.add({distanceFromStart: 100}); | ||
|
|
||
| // Then the callback is invoked with true when rendering starts | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledWith(true); | ||
| jest.advanceTimersByTime(500); | ||
|
|
||
| // Then the callback is invoked with false when rendering completes | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledTimes(2); | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledWith(false); | ||
| }); | ||
|
|
||
| it('should notify rendering state changes when a task is canceled to ensure proper cleanup', () => { | ||
| // Given a RenderTaskQueue with an isRendering change callback | ||
| const mockOnIsRenderingChange = jest.fn(); | ||
| const queue = new RenderTaskQueue(mockOnIsRenderingChange); | ||
|
|
||
| // When a task is added but canceled before completion | ||
| queue.add({distanceFromStart: 100}); | ||
| queue.cancel(); | ||
|
|
||
| // Then the callback is invoked with true when rendering starts | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledWith(true); | ||
| jest.advanceTimersByTime(500); | ||
|
|
||
| // Then the callback is invoked with false even after canceling to ensure proper cleanup | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledTimes(2); | ||
| expect(mockOnIsRenderingChange).toHaveBeenCalledWith(false); | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
where do you set this state? I don't see where it ever reaches any other state than the default
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.
Its passed into RenderTaskQueue and there its being updated
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.
oh my mistake, thanks