Skip to content

feat: add collapsible JSON payload viewer - #86

Merged
easyhooon merged 5 commits into
mainfrom
codex/issue-85-collapsible-json
Aug 6, 2026
Merged

easyhooon merged 5 commits into
mainfrom
codex/issue-85-collapsible-json

Conversation

@easyhooon

@easyhooon easyhooon commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • render valid request and response JSON as a lazy expandable tree
  • allow arrays and objects to be collapsed independently with item/field count summaries
  • preserve horizontal scrolling, malformed JSON fallback, and accessible expand/collapse actions
  • cover nested containers, empty collections, collapsed descendants, and invalid JSON behavior

Validation

  • ./gradlew :dari:detekt :dari:ktlintCheck :dari:testDebugUnitTest :sample:assembleDebug
  • ./gradlew :sample:installDebug

Closes #85

Summary by CodeRabbit

  • New Features
    • Valid JSON is now displayed as an expandable, navigable tree.
    • Collapsed objects and arrays show concise summaries, including item counts.
    • Added a setting to enable or disable JSON folding, with the preference saved between sessions.
    • Invalid JSON remains available as scrollable plain text.
    • Improved scrolling, indentation, icons, and accessibility support.
    • Added an expandable travel-itinerary sample for testing rich JSON responses.
  • Bug Fixes
    • JSON content now fills the available detail view space more reliably.
  • Tests
    • Added coverage for nested JSON, collapsing behavior, summaries, and malformed content.

배열과 객체를 경로별로 접고 펼칠 수 있는 lazy 트리 뷰어를 추가한다.
접힌 노드 개수 요약과 invalid JSON fallback을 테스트로 보장한다.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@easyhooon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 62ef629a-eadc-4a25-8a09-c539d2255da9

📥 Commits

Reviewing files that changed from the base of the PR and between e1b41d1 and 92b0440.

📒 Files selected for processing (1)
  • AGENTS.md
📝 Walkthrough

Walkthrough

JsonViewer now renders valid payloads as expandable JSON trees. Invalid JSON remains scrollable plain text. A persisted preference controls folding in request and response tabs. The sample adds a nested travel itinerary response.

Changes

JSON folding

Layer / File(s) Summary
JSON parsing and tree model
dari/src/main/kotlin/com/easyhooon/dari/ui/components/JsonViewerModel.kt, dari/src/test/kotlin/com/easyhooon/dari/ui/components/JsonViewerModelTest.kt
The model builds recursive rows for JSON objects, arrays, and primitives. Tests cover parsing, summaries, collapse behavior, token types, empty containers, and malformed input.
Interactive JSON rendering
dari/src/main/kotlin/com/easyhooon/dari/ui/components/JsonViewer.kt
The viewer renders expandable rows with scrolling, indentation, syntax colors, icons, and accessibility semantics.
Persisted folding setting and UI propagation
dari/src/main/kotlin/com/easyhooon/dari/Dari.kt, dari/src/main/kotlin/com/easyhooon/dari/data/DariPreferences.kt, dari/src/main/kotlin/com/easyhooon/dari/ui/DariActivity.kt, dari/src/main/kotlin/com/easyhooon/dari/ui/DariDetailActivity.kt, dari/src/main/kotlin/com/easyhooon/dari/ui/components/SettingsBottomSheet.kt
The setting is stored in DataStore, exposed in the settings sheet, and passed to request and response payload viewers.
Nested sample payload
sample/src/main/assets/sample.html, sample/src/main/java/com/easyhooon/dari/sample/MainActivity.kt
The sample adds a bridge request and a nested travel itinerary response.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • easyhooon/dari#34: Both changes modify persisted settings and activity preference wiring.
  • easyhooon/dari#35: Both changes extend DariPreferences, Dari.kt, activities, and SettingsBottomSheet.

Poem

A rabbit sees the JSON tree,
And folds deep branches neatly.
Keys and values line up bright,
Plain text stays in readable sight.
The setting saves each view.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The changes implement collapsible JSON trees, summaries, independent nesting, fallback rendering, and tests, but payload-state reset is not confirmed. Confirm that expansion state resets when a different payload is opened, and add a regression test if needed.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: a collapsible JSON payload viewer.
Out of Scope Changes check ✅ Passed The settings, sample itinerary, and viewer changes support or demonstrate JSON folding and remain related to issue #85.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-85-collapsible-json

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.

루트 객체와 배열은 항상 펼쳐 두고 자식 컨테이너에만 토글을 제공한다.
중첩 객체와 배열이 포함된 유효한 여행 일정 JSON 응답을 제공한다.
대용량 케이스는 truncation 및 Binder 안전성 테스트로 명확히 구분한다.
중첩 2단계부터 기본 접고 구문 색상과 아이콘 계층을 정리한다.\n설정에서 folding을 끌 수 있고 선택값을 DataStore에 유지한다.
codex/ 접두사를 금지하고 기존 타입 기반 브랜치 컨벤션을 명시한다.
@easyhooon
easyhooon merged commit afcbaef into main Aug 6, 2026
1 check passed
@easyhooon
easyhooon deleted the codex/issue-85-collapsible-json branch August 6, 2026 02:49
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.

feat: add collapsible JSON arrays and objects

1 participant