-
Notifications
You must be signed in to change notification settings - Fork 11
feat(mobile): bring GitLab and Bitbucket pull request review to GitHub parity (stack 24/30) #6016
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
Closed
iscekic
wants to merge
1
commit into
kwf/bring-mobile-gitlab-and-bitb-3792-l23
from
kwf/bring-mobile-gitlab-and-bitb-3792-l24
Closed
Changes from all commits
Commits
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
102 changes: 102 additions & 0 deletions
102
apps/mobile/src/components/pr-review/diff/pr-diff-floating-actions.backdrop.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,102 @@ | ||
| // Spot check e2-expand.png: the Finish review island floated over the | ||
| // unified diff with deleted-line text still visible around and below the | ||
| // button. The card was opaque but the bar's padding ring was not, so diff | ||
| // rows scrolled under it showed through. The bar container itself must | ||
| // carry the screen background and swallow touches in that ring. | ||
| // (Extracted from pr-diff-floating-actions.test.tsx to keep that file | ||
| // inside the max-lines budget.) | ||
|
|
||
| import * as React from 'react'; | ||
| import { describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| import '@/i18n'; | ||
| import type * as ReactI18next from 'react-i18next'; | ||
| import { PrDiffFloatingActions } from './pr-diff-floating-actions'; | ||
| import { type SelectionState } from '@/lib/pr-review/diff-selection'; | ||
|
|
||
| vi.mock('react-i18next', async importOriginal => { | ||
| const actual = await importOriginal<typeof ReactI18next>(); | ||
| return { | ||
| ...actual, | ||
| useTranslation: () => { | ||
| const i18n = actual.getI18n(); | ||
| return { t: i18n.t.bind(i18n), i18n }; | ||
| }, | ||
| }; | ||
| }); | ||
|
|
||
| vi.mock('expo-router', () => ({ | ||
| useRouter: () => ({ push: vi.fn() }), | ||
| })); | ||
|
|
||
| vi.mock('react-native', () => ({ | ||
| View: 'View', | ||
| Platform: { OS: 'ios' }, | ||
| })); | ||
|
|
||
| vi.mock('react-native-safe-area-context', () => ({ | ||
| useSafeAreaInsets: () => ({ top: 0, bottom: 0, left: 0, right: 0 }), | ||
| })); | ||
|
|
||
| vi.mock('@/components/ui/icons', () => ({ | ||
| MessageCirclePlus: () => null, | ||
| })); | ||
|
|
||
| vi.mock('@/lib/hooks/use-theme-colors', () => ({ | ||
| useThemeColors: () => ({ | ||
| primaryForeground: '#FFFFFF', | ||
| foreground: '#000000', | ||
| mutedForeground: '#6F6A61', | ||
| }), | ||
| })); | ||
|
|
||
| vi.mock('@/components/ui/button', () => ({ Button: 'Button' })); | ||
| vi.mock('@/components/ui/text', () => ({ Text: 'Text' })); | ||
| vi.mock('@/lib/pr-review/diff-selection-bridge', () => ({ | ||
| clearDiffSelection: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock('@/lib/pr-review/pending-review-provider', () => ({ | ||
| usePendingReview: () => ({ | ||
| items: [], | ||
| addComment: vi.fn(() => undefined), | ||
| updateComment: vi.fn(() => undefined), | ||
| removeComment: vi.fn(() => undefined), | ||
| clear: vi.fn(() => undefined), | ||
| }), | ||
| })); | ||
|
|
||
| const baseProps = { | ||
| owner: 'octocat', | ||
| repo: 'hello', | ||
| number: 7, | ||
| viewMode: 'unified' as const, | ||
| selection: null as SelectionState | null, | ||
| onClearSelection: vi.fn(), | ||
| }; | ||
|
|
||
| function renderBar(): React.ReactElement { | ||
| // eslint-disable-next-line new-cap -- plain function component, no hooks state needed for the container props | ||
| return PrDiffFloatingActions(baseProps); | ||
| } | ||
|
|
||
| describe('PrDiffFloatingActions opaque backdrop (spot check e2)', () => { | ||
| it('paints the bar container with the screen background and swallows touches', () => { | ||
| // With a transparent container the diff rows scrolled under the bar | ||
| // stayed visible around and below the button. The container carries the | ||
| // screen background, and the removed `pointerEvents="box-none"` means a | ||
| // tap in the padding ring can never reach a diff row hidden behind it. | ||
| const props = renderBar().props as { className?: string; pointerEvents?: string }; | ||
| expect(props.pointerEvents).toBeUndefined(); | ||
| expect((props.className ?? '').split(' ')).toContain('bg-background'); | ||
| }); | ||
|
|
||
| it('keeps the action card on the same background inside the bar', () => { | ||
| const card = (renderBar().props as { children?: React.ReactElement }).children; | ||
| if (!card) { | ||
| throw new Error('floating action card not found'); | ||
| } | ||
| const classes = (card.props as { className?: string }).className ?? ''; | ||
| expect(classes.split(' ')).toContain('bg-background'); | ||
| }); | ||
| }); |
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
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
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
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.
WARNING: Empty GitLab discussion pages still keep
nextCursor, so later human comments can become unreachableFiltering
comments.length === 0can yieldthreads: []whilenextCursorstill reflects the raw GitLab page of 50 discussions.selectDiscussionTabViewthen treats that as terminalemptyand never mounts the list/fetchNextPage. A first page of system-only notes (pushes, labels, assignments) will hide real comments on later pages.Keep fetching while
nextCursoris set, or compact empty pages before the empty check.Reply with
@kilocode-bot fix itto have Kilo Code address this issue.