From e04b0c8d1049dfc36177d2fa145f4b5f6fde0267 Mon Sep 17 00:00:00 2001 From: Jack Stenglein Date: Thu, 4 Apr 2024 16:56:03 -0500 Subject: [PATCH] Fix comment collapse width --- backend/database/games.go | 4 ++++ .../src/board/pgn/boardTools/underboard/comments/Comment.tsx | 2 ++ scripts/convert_game_comments.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/database/games.go b/backend/database/games.go index d1e302d49..e6157383e 100644 --- a/backend/database/games.go +++ b/backend/database/games.go @@ -960,6 +960,10 @@ func (repo *dynamoRepository) SetGameReview(cohort, id string, review *GameRevie } func getCommentPath(parentIds string, exprAttrNames map[string]*string) string { + if parentIds == "" { + return "" + } + var parentPath strings.Builder parentIdList := strings.Split(parentIds, ",") for i, id := range parentIdList { diff --git a/frontend/src/board/pgn/boardTools/underboard/comments/Comment.tsx b/frontend/src/board/pgn/boardTools/underboard/comments/Comment.tsx index 4b379ebe4..00f601e89 100644 --- a/frontend/src/board/pgn/boardTools/underboard/comments/Comment.tsx +++ b/frontend/src/board/pgn/boardTools/underboard/comments/Comment.tsx @@ -85,6 +85,8 @@ const BaseComment: React.FC = ({ alignItems='center' sx={{ width: '20px', + minWidth: '20px', + maxWidth: '20px', cursor: 'pointer', ':hover .MuiDivider-root': { diff --git a/scripts/convert_game_comments.py b/scripts/convert_game_comments.py index f5f5e35b5..1a98901e9 100644 --- a/scripts/convert_game_comments.py +++ b/scripts/convert_game_comments.py @@ -29,7 +29,8 @@ def process_game(batch, game): }, 'createdAt': c['createdAt'], 'updatedAt': c['updatedAt'], - 'content': c['content'] + 'content': c['content'], + 'replies': {} } position = position_comments.get(STARTING_FEN, {}) position[new_comment['id']] = new_comment