Fix desktop right-side panel chrome overlap (#806)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
thomaspblock
2026-06-02 10:37:36 -04:00
committed by GitHub
parent ede8ddb425
commit 5bed17a117
36 changed files with 1026 additions and 574 deletions

View File

@@ -17,10 +17,16 @@ export function parsePromptText(text: string): {
sections: PromptSection[];
userText: string;
userTitle: string;
userPubkey: string | null;
} {
const sections = parsePromptSections(text);
if (sections.length === 0) {
return { sections: [], userText: text.trim(), userTitle: "Prompt" };
return {
sections: [],
userText: text.trim(),
userTitle: "Prompt",
userPubkey: null,
};
}
const eventSection = sections.find((section) =>
@@ -29,12 +35,16 @@ export function parsePromptText(text: string): {
const eventContent = eventSection
? extractEventContent(eventSection.body)
: "";
const eventAuthorPubkey = eventSection
? extractEventAuthorPubkey(eventSection.body)
: null;
const eventKind = eventSection?.title.split(":").slice(1).join(":").trim();
return {
sections,
userText: eventContent,
userTitle: eventKind ? titleCase(eventKind) : "Sprout event",
userPubkey: eventAuthorPubkey,
};
}
@@ -79,6 +89,11 @@ function extractEventContent(body: string): string {
return contentMatch?.[1]?.trim() ?? "";
}
function extractEventAuthorPubkey(body: string): string | null {
const fromMatch = body.match(/^From:.*\bhex:\s*([0-9a-fA-F]{64})/m);
return fromMatch?.[1]?.toLowerCase() ?? null;
}
export function extractContentText(value: unknown): string {
if (typeof value === "string") return value;
if (Array.isArray(value)) return value.map(extractBlockText).join("\n");