* feat(app): add pull request panel context actions Attach pull request comments, reviews, and failed check details to chat context. The PR panel now lives in its own module so the activity, query, and context policies have one home. * fix(server): mark capped check details as truncated * fix(app): preserve concurrent PR panel attachments * fix(server): preserve annotation truncation state * fix(app): keep matrix check attachments distinct * fix(app): streamline pull request context attachments * fix(app): simplify pull request feedback rendering * feat(app): group pull request review threads * fix(app): tidy pull request panel boundaries * fix: use worktree cwd for dev services * fix(app): keep git query keys UI-free * feat(app): collapse resolved comments and add chat actions to headers * fix: address PR feedback and Playwright flakes * fix(app): hide check chat action without attachment scope * fix(server): dedupe inline review timeline comments
55 lines
1.9 KiB
TypeScript
55 lines
1.9 KiB
TypeScript
import { useMemo, type ReactNode } from "react";
|
|
import {
|
|
Text,
|
|
View,
|
|
type StyleProp,
|
|
type TextProps,
|
|
type TextStyle,
|
|
type ViewStyle,
|
|
} from "react-native";
|
|
|
|
interface MarkdownTextSpanProps {
|
|
style?: StyleProp<TextStyle>;
|
|
monoSurface?: boolean;
|
|
children: ReactNode;
|
|
onPress?: TextProps["onPress"];
|
|
accessibilityRole?: TextProps["accessibilityRole"];
|
|
}
|
|
|
|
// Android's <Text selectable> enables per-text-node selection natively. Each
|
|
// sibling Text is its own selection scope — drag can't span across siblings
|
|
// (that requires a single UITextView ancestor and is iOS-only). onPress works
|
|
// natively here, so links routed through this span stay tappable on Android.
|
|
export function MarkdownTextSpan({
|
|
style,
|
|
children,
|
|
onPress,
|
|
accessibilityRole,
|
|
}: MarkdownTextSpanProps) {
|
|
return (
|
|
<Text selectable style={style} onPress={onPress} accessibilityRole={accessibilityRole}>
|
|
{children}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
interface MarkdownParagraphViewProps {
|
|
paragraphStyle: ViewStyle;
|
|
containsImage?: boolean;
|
|
children: ReactNode;
|
|
}
|
|
|
|
const MARKDOWN_PARAGRAPH_RESET: ViewStyle = {};
|
|
|
|
// Paragraph stays a <View>, not a <Text>, for layout fidelity. RN Android's
|
|
// text engine *does* accept inline View children (TextInlineViewPlaceholderSpan
|
|
// in ReactBaseTextShadowNode), so this isn't a crash-avoidance choice — but
|
|
// inline-placeholder spans collapse block-level children (e.g. paragraph
|
|
// images) into one-character placeholders, which destroys image row layout.
|
|
// <View> preserves the original block layout; the trade-off is no cross-span
|
|
// selection on Android (a UITextView-style trick has no Android equivalent).
|
|
export function MarkdownParagraphView({ paragraphStyle, children }: MarkdownParagraphViewProps) {
|
|
const style = useMemo(() => [paragraphStyle, MARKDOWN_PARAGRAPH_RESET], [paragraphStyle]);
|
|
return <View style={style}>{children}</View>;
|
|
}
|