File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { ASSISTANT_CITATION_MARKDOWN_PREFIX } from "@t3tools/shared/assistantCitations" ;
12import { Badge } from "~/components/ui/badge" ;
23import { useComposerDraftStore , type ComposerThreadTarget } from "~/composerDraftStore" ;
34import { draftCitationMarkers } from "./assistantCitationMarkers.logic" ;
@@ -34,7 +35,7 @@ export function AssistantCitationMarkers({
3435 onOpen : ( key : string , anchor : AssistantCitationSourceAnchor ) => void ;
3536} ) {
3637 const citationJson = JSON . stringify (
37- showingDraft && prompt . includes ( "[Assistant quote](t3-citation://v1/" )
38+ showingDraft && prompt . includes ( ASSISTANT_CITATION_MARKDOWN_PREFIX )
3839 ? draftCitationMarkers ( buildDocJson ( prompt , ( ) => null , { styling : richTextEnabled } ) )
3940 : [ ] ,
4041 ) ;
@@ -198,7 +199,7 @@ function CitationMarkers({
198199 onBlur = { updateCitationHighlight }
199200 render = { < button type = "button" /> }
200201 hidden = { ! viewport }
201- className = "pointer-events-auto absolute data-[citation-highlight]:ring-2 data-[citation-highlight]:ring-ring data-[citation-highlight]:ring-offset-2 data-[citation-highlight]:ring-offset-background "
202+ className = "pointer-events-auto absolute"
202203 aria-label = { `Edit citation ${ number } comment` }
203204 onPointerDown = { ( event ) => event . preventDefault ( ) }
204205 onClick = { ( ) => {
Original file line number Diff line number Diff line change @@ -2549,6 +2549,11 @@ code {
25492549 [data-has-draft-citations ] {
25502550 --draft-citation-gutter : 2rem ;
25512551 }
2552+ [data-citation-marker-key ][data-citation-highlight ] {
2553+ box-shadow :
2554+ 0 0 0 2px var ( --background ) ,
2555+ 0 0 0 4px var ( --ring ) ;
2556+ }
25522557 . chat-scroll-to-bottom ,
25532558 . chat-banner-lane {
25542559 inset-inline-start : var ( --chat-lane-inset-start , 0px ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import * as Schema from "effect/Schema";
88
99const CITATION_PROTOCOL = "t3-citation:" ;
1010const CITATION_HREF_PREFIX = `${ CITATION_PROTOCOL } //v1/` ;
11+ export const ASSISTANT_CITATION_MARKDOWN_PREFIX = `[Assistant quote](${ CITATION_HREF_PREFIX } ` ;
1112// Percent encoding needs up to nine characters per UTF-16 code unit; 16k covers selectors.
1213const MAX_CITATION_HREF_LENGTH =
1314 9 * ( ASSISTANT_CITATION_MAX_TEXT_LENGTH + ASSISTANT_CITATION_MAX_COMMENT_LENGTH ) + 16_000 ;
You can’t perform that action at this time.
0 commit comments