Skip to content

Conversation

@weiran
Copy link
Owner

@weiran weiran commented Nov 3, 2025

  • Removed custom Divider with padding from CommentRow
  • Changed listRowSeparator from .hidden to .visible
  • Native separator automatically adjusts width based on comment hierarchy

Summary by CodeRabbit

  • Accessibility

    • Simplified accessibility hint text for comment interactions
  • Style

    • Improved indentation for nested comments to enhance visual hierarchy
    • Enhanced separator visibility in comments list
    • Refined overall comment thread layout for better readability

claude and others added 2 commits November 3, 2025 06:47
- Removed custom Divider with padding from CommentRow
- Changed listRowSeparator from .hidden to .visible
- Native separator automatically adjusts width based on comment hierarchy
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

The Comments component UI receives visual and accessibility refinements. List row separators transition from hidden to visible, layout insets are restructured with level-based leading indentation, an internal Divider is removed, and accessibility hint text is updated.

Changes

Cohort / File(s) Summary
UI and Layout Refinements
Features/Comments/Sources/Comments/CommentsComponents.swift
Separators now visible in CommentsForEach; removed Divider from CommentRow; insets split into two calls (top/bottom/trailing: 16, leading: (comment.level + 1) × 16); accessibility hint updated from "Double-tap to collapse/expand" to "Tap to collapse/expand"; upvote and swipe action logic unchanged

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring attention:

  • Verify the level-based inset calculation (comment.level + 1) * 16 produces intended visual hierarchy and doesn't cause excessive indentation at deeper nesting levels
  • Confirm separator visibility doesn't introduce visual clutter or accessibility issues
  • Ensure accessibility hint change accurately reflects the single-tap gesture requirement

Poem

🐰 The comments now breathe with space between,
No hidden seams, all clearly seen!
Indents cascade by nesting's call,
Each level distinct, like nested dolls.
One tap, not two—accessibility found,
Your feedback flow, now spaced just right!

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of removing custom padding from comment separators by switching to native list row separators.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/remove-comment-separator-padding-011CUkWEE8dcKN7SxEuPHG7f

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a725036 and 1daf79b.

📒 Files selected for processing (1)
  • Features/Comments/Sources/Comments/CommentsComponents.swift (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
Features/*/Sources/**/*.swift

📄 CodeRabbit inference engine (AGENTS.md)

Features/*/Sources/**/*.swift: SwiftUI views in Features should use @EnvironmentObject for navigation
Annotate UI code with @mainactor

Files:

  • Features/Comments/Sources/Comments/CommentsComponents.swift
**/*.swift

📄 CodeRabbit inference engine (AGENTS.md)

**/*.swift: Use Swift concurrency (async/await) instead of completion handlers where appropriate
Adopt Sendable where needed to ensure thread safety across concurrency boundaries

Files:

  • Features/Comments/Sources/Comments/CommentsComponents.swift
🧬 Code graph analysis (1)
Features/Comments/Sources/Comments/CommentsComponents.swift (2)
Features/Comments/Sources/Comments/CommentsViewModel.swift (1)
  • toggleCommentVisibility (165-185)
Features/Feed/Sources/Feed/FeedView.swift (1)
  • post (271-307)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (2)
Features/Comments/Sources/Comments/CommentsComponents.swift (2)

166-166: LGTM! Native separator now visible to support hierarchy.

The change to .visible aligns with the PR objectives to rely on the native separator, which automatically adjusts width based on the comment hierarchy defined by the leading insets.


315-315: Verify accessibility hint accuracy for VoiceOver users.

The hint changed from "Double-tap" to "Tap", but VoiceOver users typically need to double-tap to activate elements with .accessibilityAddTraits(.isButton) (one tap to focus, second to activate). Please confirm whether "Tap" is the intended and accurate instruction for VoiceOver users.

Comment on lines +310 to +311
.listRowInsets([.top, .bottom, .trailing], 16)
.listRowInsets([.leading], CGFloat((comment.level + 1) * 16))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that chained .listRowInsets calls merge correctly.

Calling .listRowInsets twice with different edge sets requires verification that the custom extension merges the insets rather than having the second call override the first. If the second call overrides, the top/bottom/trailing insets would be lost.

Run the following script to locate the extension definition and verify its behaviour:


🏁 Script executed:

#!/bin/bash
# Description: Find the custom listRowInsets extension definition

# Search for the extension that takes an array of edges and a value
rg -n -A 10 'func listRowInsets.*\[.*Edge' --type swift

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Description: Broader search for listRowInsets definition

# First, search for any mention of listRowInsets in the codebase
echo "=== Searching for listRowInsets keyword ==="
rg -n 'listRowInsets' --type swift

# Also check the target file to understand context
echo -e "\n=== Checking target file context ==="
fd -t f CommentsComponents.swift

Length of output: 499


🏁 Script executed:

#!/bin/bash
# Description: Search for extension definition and file context

echo "=== Searching for extension definitions with listRowInsets ==="
rg -n 'extension.*View' --type swift -A 15 | grep -A 15 'listRowInsets'

echo -e "\n=== Checking target file beginning (imports and declarations) ==="
head -50 Features/Comments/Sources/Comments/CommentsComponents.swift

echo -e "\n=== Searching extension directories ==="
fd -t f '\.swift$' | grep -i -E '(extension|helper|util)' | head -20

Length of output: 3782


🏁 Script executed:

#!/bin/bash
# Description: Search for listRowInsets method definition more broadly

echo "=== Searching for listRowInsets method definition (not extension keyword) ==="
rg -n 'func listRowInsets' --type swift -B 5 -A 10

echo -e "\n=== Searching DesignSystem module for extensions ==="
fd -t f '\.swift$' DesignSystem/ | xargs grep -l 'listRowInsets' 2>/dev/null

echo -e "\n=== Searching Shared module for extensions ==="
fd -t f '\.swift$' Shared/ | xargs grep -l 'listRowInsets' 2>/dev/null

echo -e "\n=== Checking if View extension exists anywhere with any listRowInsets variant ==="
rg -n 'extension View' --type swift -A 5 | grep -B 5 'listRowInsets'

Length of output: 736


Custom listRowInsets extension is missing and code will not compile.

Lines 310–311 call .listRowInsets([edges], value) with a custom signature that does not exist anywhere in the codebase. The only listRowInsets method available is the standard SwiftUI API that accepts EdgeInsets() (used at line 557).

Either implement the custom extension to support this signature, or refactor to use EdgeInsets directly:

.listRowInsets(EdgeInsets(top: 0, leading: CGFloat((comment.level + 1) * 16), bottom: 0, trailing: 16))
🤖 Prompt for AI Agents
In Features/Comments/Sources/Comments/CommentsComponents.swift around lines
310–311, the calls to .listRowInsets([.top, .bottom, .trailing], 16) and
.listRowInsets([.leading], CGFloat((comment.level + 1) * 16)) use a non‑existent
custom signature and cause a compile error; replace these calls with a single
.listRowInsets(EdgeInsets(...)) call that sets top: 0, bottom: 0, trailing: 16
and leading: CGFloat((comment.level + 1) * 16) (or, if you prefer, implement a
small extension that accepts an array of Edge.Set and a value and constructs the
corresponding EdgeInsets before calling the standard .listRowInsets).

@weiran weiran merged commit edb5b75 into master Nov 3, 2025
4 checks passed
@weiran weiran deleted the claude/remove-comment-separator-padding-011CUkWEE8dcKN7SxEuPHG7f branch November 3, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants