@@ -41,6 +41,9 @@ export function DocFeedbackProvider({
4141 const [ blockContentHashes , setBlockContentHashes ] = React . useState <
4242 Map < string , string >
4343 > ( new Map ( ) )
44+ const [ blockMarkdowns , setBlockMarkdowns ] = React . useState <
45+ Map < string , string >
46+ > ( new Map ( ) )
4447 const [ hoveredBlockId , setHoveredBlockId ] = React . useState < string | null > (
4548 null ,
4649 )
@@ -81,6 +84,7 @@ export function DocFeedbackProvider({
8184 const blocks = findReferenceableBlocks ( container )
8285 const selectorMap = new Map < string , string > ( )
8386 const hashMap = new Map < string , string > ( )
87+ const markdownMap = new Map < string , string > ( )
8488 const listeners = new Map <
8589 HTMLElement ,
8690 { enter : ( e : MouseEvent ) => void ; leave : ( e : MouseEvent ) => void }
@@ -94,6 +98,7 @@ export function DocFeedbackProvider({
9498 const identifier = await getBlockIdentifier ( block )
9599 selectorMap . set ( blockId , identifier . selector )
96100 hashMap . set ( blockId , identifier . contentHash )
101+ markdownMap . set ( blockId , block . textContent ?. trim ( ) || '' )
97102
98103 // Add hover handlers with visual feedback
99104 const handleMouseEnter = ( e : MouseEvent ) => {
@@ -139,6 +144,7 @@ export function DocFeedbackProvider({
139144 ) . then ( ( ) => {
140145 setBlockSelectors ( new Map ( selectorMap ) )
141146 setBlockContentHashes ( new Map ( hashMap ) )
147+ setBlockMarkdowns ( new Map ( markdownMap ) )
142148
143149 // Visual indicators will be updated by the separate effect below
144150 } )
@@ -298,6 +304,7 @@ export function DocFeedbackProvider({
298304 type = { creatingState . type }
299305 blockSelector = { blockSelectors . get ( creatingState . blockId ) || '' }
300306 blockContentHash = { blockContentHashes . get ( creatingState . blockId ) || '' }
307+ blockMarkdown = { blockMarkdowns . get ( creatingState . blockId ) || '' }
301308 pagePath = { pagePath }
302309 libraryId = { libraryId }
303310 libraryVersion = { libraryVersion }
@@ -439,6 +446,7 @@ function CreatingFeedbackPortal({
439446 type,
440447 blockSelector,
441448 blockContentHash,
449+ blockMarkdown,
442450 pagePath,
443451 libraryId,
444452 libraryVersion,
@@ -448,6 +456,7 @@ function CreatingFeedbackPortal({
448456 type : 'note' | 'improvement'
449457 blockSelector : string
450458 blockContentHash ?: string
459+ blockMarkdown ?: string
451460 pagePath : string
452461 libraryId : string
453462 libraryVersion : string
@@ -492,6 +501,7 @@ function CreatingFeedbackPortal({
492501 type = { type }
493502 blockSelector = { blockSelector }
494503 blockContentHash = { blockContentHash }
504+ blockMarkdown = { blockMarkdown }
495505 pagePath = { pagePath }
496506 libraryId = { libraryId }
497507 libraryVersion = { libraryVersion }
@@ -506,6 +516,7 @@ function CreatingFeedbackNote({
506516 type,
507517 blockSelector,
508518 blockContentHash,
519+ blockMarkdown,
509520 pagePath,
510521 libraryId,
511522 libraryVersion,
@@ -514,6 +525,7 @@ function CreatingFeedbackNote({
514525 type : 'note' | 'improvement'
515526 blockSelector : string
516527 blockContentHash ?: string
528+ blockMarkdown ?: string
517529 pagePath : string
518530 libraryId : string
519531 libraryVersion : string
@@ -577,6 +589,7 @@ function CreatingFeedbackNote({
577589 libraryVersion : variables . data . libraryVersion ,
578590 blockSelector : variables . data . blockSelector ,
579591 blockContentHash : variables . data . blockContentHash || null ,
592+ blockMarkdown : variables . data . blockMarkdown || null ,
580593 status : 'pending' ,
581594 isDetached : false ,
582595 isCollapsed : false ,
@@ -645,6 +658,7 @@ function CreatingFeedbackNote({
645658 libraryVersion,
646659 blockSelector,
647660 blockContentHash,
661+ blockMarkdown,
648662 } ,
649663 } )
650664 }
0 commit comments