Merge pull request #16120 from overleaf/ii-rp-track-changes-indicators

[web] Review panel track changes indicators

GitOrigin-RevId: 8911ca1774648ecdde6f0ee173b06f20b1de4e9a
This commit is contained in:
ilkin-overleaf 2023-12-07 15:45:35 +02:00 committed by Copybot
parent c3689ca6f3
commit e450b702e8
3 changed files with 9 additions and 3 deletions

View file

@ -54,7 +54,7 @@ function AggregateChangeEntry({
? content.substring(0, contentLimit)
: content
const handleEntryClick = useEntryClick(docId, offset)
const handleEntryClick = useEntryClick(docId, offset, endHover)
const handleDeletionToggleCollapse = () => {
setIsDeletionCollapsed(value => !value)

View file

@ -50,7 +50,7 @@ function ChangeEntry({
const needsCollapsing = content.length > contentLimit
const isInsert = type === 'insert'
const handleEntryClick = useEntryClick(docId, offset)
const handleEntryClick = useEntryClick(docId, offset, endHover)
const handleToggleCollapse = () => {
setIsCollapsed(value => !value)

View file

@ -1,7 +1,11 @@
import { useReviewPanelUpdaterFnsContext } from '@/features/source-editor/context/review-panel/review-panel-context'
import { DocId } from '../../../../../../../types/project-settings'
export function useEntryClick(docId: DocId, offset: number) {
export function useEntryClick(
docId: DocId,
offset: number,
cb?: (e: React.MouseEvent<HTMLDivElement>) => void
) {
const { gotoEntry } = useReviewPanelUpdaterFnsContext()
return (e: React.MouseEvent<HTMLDivElement>) => {
@ -23,5 +27,7 @@ export function useEntryClick(docId: DocId, offset: number) {
gotoEntry(docId, offset)
}
}
cb?.(e)
}
}