Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions apps/web/core/claims/browse/claim-page-view.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ vi.mock('~/core/debates/matchmaking/matchmaking-claim-card', () => ({
isConnected: false,
isResponsePending: mocks.isResponsePending,
}),
ResponseConfirmingNote: () => <p data-testid="confirming" />,
}));
vi.mock('./claim-position-comment', () => ({
ClaimPositionCommentControl: (props: Record<string, unknown>) => {
Expand Down Expand Up @@ -561,20 +560,20 @@ describe('ClaimPageView description', () => {
});

describe('ClaimPageView position', () => {
// The claim page is where a confirming response was pressed again and published a retraction:
// it drew no sign of the wait, so a held pill looked like a settled one.
it('says the response is confirming, and marks the pills pending, while it is', () => {
// The claim page is where a confirming response was pressed again and published a retraction.
// The pills guard against that quietly: the side reads as taken at once, with no note or wait
// cursor, and only the presses that would undo it are dropped until it lands.
it('marks the pills pending while the response confirms, without announcing a wait', () => {
mocks.isResponsePending = true;
render(<ClaimPageView entityId="claim-1" spaceId="space-1" />);

expect(screen.getByTestId('confirming')).toBeInTheDocument();
expect(mocks.positionControl?.pending).toBe(true);
expect(screen.queryByText(/waiting for confirmation/i)).toBeNull();
});

it('says nothing once it has landed', () => {
it('releases the pills once it has landed', () => {
render(<ClaimPageView entityId="claim-1" spaceId="space-1" />);

expect(screen.queryByTestId('confirming')).toBeNull();
expect(mocks.positionControl?.pending).toBe(false);
});
});
Expand Down
3 changes: 1 addition & 2 deletions apps/web/core/claims/browse/claim-page-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
useBackfillReadinessForHeldPosition,
} from '~/core/debates/backfill-readiness-for-held-position';
import { useDebateClaims } from '~/core/debates/hooks';
import { ResponseConfirmingNote, useClaimPositionControl } from '~/core/debates/matchmaking/matchmaking-claim-card';
import { useClaimPositionControl } from '~/core/debates/matchmaking/matchmaking-claim-card';
import { usePrivySignIn } from '~/core/hooks/use-privy-sign-in';
import { ID } from '~/core/id';
import { hasRecordToShow } from '~/core/profile/profile-proposer';
Expand Down Expand Up @@ -546,7 +546,6 @@ function ClaimPositionSection({
// Explore's pill row width, so the two read as one control.
positionRowClassName="max-w-[360px]"
/>
{control.isResponsePending ? <ResponseConfirmingNote /> : null}
{control.responseError ? (
<div role="alert" className="mt-2">
<Text as="p" variant="footnote" color="red-01">
Expand Down
12 changes: 0 additions & 12 deletions apps/web/core/debates/matchmaking/matchmaking-claim-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1005,17 +1005,6 @@ function UnresolvableControls({
);
}

/** Said under the pills while the viewer's response is confirming, in the vote arrows' words. */
export function ResponseConfirmingNote() {
return (
<div role="status" className="mt-2">
<Text as="p" variant="footnote" color="grey-04">
{RESPONSE_CONFIRMING_COPY}
</Text>
</div>
);
}

export function PositionRow({
positions,
responseKind,
Expand Down Expand Up @@ -1232,7 +1221,6 @@ function PositionButton({
className={cx(
className,
'transition-colors disabled:opacity-60',
pending && 'cursor-progress',
!selected && !disabled && !pending && 'hover:border-text'
)}
>
Expand Down
Loading