Skip to content

Commit

Permalink
Tweak conversation rendering so reviews without content show up
Browse files Browse the repository at this point in the history
Previously if you had a PR that was approved but the approver didn't
include a message, the review simply wouldn't show up in the UI
  • Loading branch information
gizmo385 committed Dec 21, 2024
1 parent f3478fc commit e0741b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lazy_github/ui/widgets/conversations.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,11 @@ def compose(self) -> ComposeResult:
else:
review_state_text = self.review.state.title()
yield Label(f"Review from {self.review.user.login} ({review_state_text})")
yield Markdown(self.review.body)
for comment in self.review.comments:
if comment_node := self.hierarchy[comment.id]:
yield ReviewConversation(self.pr, comment_node)
if self.review.body:
yield Markdown(self.review.body)
for comment in self.review.comments:
if comment_node := self.hierarchy[comment.id]:
yield ReviewConversation(self.pr, comment_node)

def action_reply_to_review(self) -> None:
self.app.push_screen(NewCommentModal(self.pr.repo, self.pr, self.review))
4 changes: 2 additions & 2 deletions lazy_github/ui/widgets/pull_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ async def fetch_conversation(self) -> None:
for review in reviews:
if review.body:
handled_comment_node_ids.extend([c.id for c in review.comments])
review_container = ReviewContainer(self.pr, review, review_hierarchy)
self.comments_and_reviews.mount(review_container)
review_container = ReviewContainer(self.pr, review, review_hierarchy)
self.comments_and_reviews.mount(review_container)

for comment in comments:
if comment.body and comment.id not in handled_comment_node_ids:
Expand Down

0 comments on commit e0741b2

Please sign in to comment.