story-206: default to claude-code-pty on first use
Squash merge of feature/story-206 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,8 @@ export function parseCodeRefs(text: string): CodeRefPart[] {
|
||||
const re = new RegExp(CODE_REF_PATTERN.source, "g");
|
||||
let match: RegExpExecArray | null;
|
||||
|
||||
while ((match = re.exec(text)) !== null) {
|
||||
match = re.exec(text);
|
||||
while (match !== null) {
|
||||
if (match.index > lastIndex) {
|
||||
parts.push({ type: "text", value: text.slice(lastIndex, match.index) });
|
||||
}
|
||||
@@ -33,6 +34,7 @@ export function parseCodeRefs(text: string): CodeRefPart[] {
|
||||
line: Number(match[2]),
|
||||
});
|
||||
lastIndex = re.lastIndex;
|
||||
match = re.exec(text);
|
||||
}
|
||||
|
||||
if (lastIndex < text.length) {
|
||||
@@ -93,15 +95,23 @@ export function InlineCodeWithRefs({ text }: InlineCodeWithRefsProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{parts.map((part, i) => {
|
||||
if (part.type === "ref" && part.path !== undefined && part.line !== undefined) {
|
||||
{parts.map((part) => {
|
||||
if (
|
||||
part.type === "ref" &&
|
||||
part.path !== undefined &&
|
||||
part.line !== undefined
|
||||
) {
|
||||
return (
|
||||
<CodeRefLink key={`ref-${i}`} path={part.path} line={part.line}>
|
||||
<CodeRefLink
|
||||
key={`ref-${part.path}:${part.line}`}
|
||||
path={part.path}
|
||||
line={part.line}
|
||||
>
|
||||
{part.value}
|
||||
</CodeRefLink>
|
||||
);
|
||||
}
|
||||
return <span key={`text-${i}`}>{part.value}</span>;
|
||||
return <span key={`text-${part.value}`}>{part.value}</span>;
|
||||
})}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user