Various commenting improvements (#4941)

* fix: New threads attached to previous as replies

* fix: Cannot use floating toolbar properly in comments

* perf: Avoid re-writing history on click in editor

* fix: Comment on text selection

* fix: 'Copy link' on comments uses wrong hostname

* Show comment buttons on input focus rather than non-empty input
Increase maximum sidebar size

* Allow opening comments from document menu

* fix: Clicking comment menu should not focus thread

* fix: Selection color

* fix: Draft comments not restored

* Add border above document level comment input

* fix: Floating toolbar not constrainted by offset parent

* fix flash of no comment on saving

* fix: Clicking on editor does not remove draft mark
This commit is contained in:
Tom Moor
2023-02-27 19:50:35 -05:00
committed by GitHub
parent 6b00ced48f
commit fff0812659
7 changed files with 91 additions and 72 deletions

View File

@@ -86,20 +86,14 @@ function DocumentEditor(props: Props, ref: React.RefObject<any>) {
);
const handleClickComment = React.useCallback(
(commentId?: string) => {
if (commentId) {
ui.expandComments();
history.replace({
pathname: window.location.pathname.replace(/\/history$/, ""),
state: { commentId },
});
} else if (focusedComment) {
history.replace({
pathname: window.location.pathname,
});
}
(commentId: string) => {
ui.expandComments();
history.replace({
pathname: window.location.pathname.replace(/\/history$/, ""),
state: { commentId },
});
},
[ui, focusedComment, history]
[ui, history]
);
// Create a Comment model in local store when a comment mark is created, this