Skip to content

feat(example): Update sample app#1

Open
komodgn wants to merge 3 commits intodevelopfrom
feature/demo
Open

feat(example): Update sample app#1
komodgn wants to merge 3 commits intodevelopfrom
feature/demo

Conversation

@komodgn
Copy link
Copy Markdown
Owner

@komodgn komodgn commented May 5, 2026

Summary by CodeRabbit

  • New Features

    • Interactive code editor with live preview added to the example app, including editable input and a separate preview pane.
  • Improvements

    • Responsive layout: editor and preview stack on narrow screens and display side-by-side on wider screens.
    • Improved keyboard and window inset handling for a smoother typing and viewing experience.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@komodgn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 13 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e86860fc-9909-4f1c-8c39-828b0af9c4d9

📥 Commits

Reviewing files that changed from the base of the PR and between 188abed and 7e539a1.

📒 Files selected for processing (1)
  • example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
📝 Walkthrough

Walkthrough

The app's demo was converted from a static preview to an editable code editor with live preview and responsive two-pane layout. New composables manage editable state and scrolling. The Android manifest adds android:windowSoftInputMode="adjustResize" for soft-keyboard resizing.

Changes

Interactive Editor with Live Preview

Layer / File(s) Summary
Data Shape / Initial Content
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
getInitialCode(version: String) now returns a CodeDisplay() snippet with a greeting that interpolates version as "Hello, CodeView! 🎉v$version".
State & Content Initialization
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
App() initializes userInput from getInitialCode(...) and uses rememberScrollState() to track scrolling.
Core Layout & Insets
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
App() uses BoxWithConstraints to switch between stacked (compact) and side-by-side (wide) layouts; Scaffold contentWindowInsets set to zero and content applies statusBarsPadding, displayCutoutPadding, and imePadding.
UI Component Abstractions
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
Added EditorSection(code, onValueChange, modifier) (labeled TextField) and CodeViewSection(code, modifier) (labeled CodeView) as top-level composables.
Imports / Wiring
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
Imports expanded for BoxWithConstraints, WindowInsets, padding helpers, layout primitives, and Compose state utilities.
Platform Soft Keyboard Handling
example/src/androidMain/AndroidManifest.xml
MainActivity now includes android:windowSoftInputMode="adjustResize".

Sequence Diagram

sequenceDiagram
    participant User
    participant EditorSection
    participant AppState
    participant CodeViewSection
    participant CodeView

    User->>EditorSection: type text in TextField
    EditorSection->>AppState: onValueChange(newCode)
    AppState->>AppState: update userInput state
    AppState->>CodeViewSection: provide updated code
    CodeViewSection->>CodeView: render with code
    CodeView-->>CodeViewSection: formatted preview
    CodeViewSection-->>User: display preview
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit taps keys with delight,
The preview wakes, both day and night.
Type a line, watch colors play,
Side-by-side the changes stay.
Soft‑keyboard friendly, ready to hop—🐰✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Update sample app' is vague and generic, lacking specificity about what aspects of the sample app were updated or what the primary changes are. Make the title more specific by highlighting the key changes, such as 'feat(example): Add responsive layout and keyboard handling to sample app' or 'feat(example): Refactor example app with responsive UI and editor section'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/demo

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
Copy Markdown

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt`:
- Around line 90-96: The TextField currently lacks a label for accessibility;
remove the separate Text("Edit Code") and add the label parameter to the
TextField (e.g., label = { Text("Edit Code") }) so the field exposes a semantic
label to assistive tech; keep existing props like value = code, onValueChange =
onValueChange, modifier = Modifier.fillMaxWidth(), and textStyle =
MaterialTheme.typography.bodyMedium when updating the invocation of TextField.
- Around line 54-63: The BoxWithConstraints modifier chain inside the composable
(the block using innerPadding and modifiers
.padding(innerPadding).fillMaxSize().statusBarsPadding().displayCutoutPadding().imePadding())
is missing navigation bar insets; add .navigationBarsPadding() into that
Modifier chain (e.g., before or after imePadding()) so bottom content isn't
obscured by persistent Android navigation bars.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8feb7135-7d44-4c8b-b903-838644c4d8bd

📥 Commits

Reviewing files that changed from the base of the PR and between 19ed0ec and 3258d35.

📒 Files selected for processing (2)
  • example/src/androidMain/AndroidManifest.xml
  • example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt

…ation.kt


- [skip ci]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@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.

♻️ Duplicate comments (1)
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt (1)

54-62: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

navigationBarsPadding() is still missing after zeroing Scaffold insets.

Because contentWindowInsets is set to zero, bottom system insets must be reapplied explicitly. Without navigationBarsPadding(), bottom content can still sit under persistent Android nav bars when IME is hidden.

Suggested fix
             BoxWithConstraints(
                 modifier = Modifier
                     .padding(innerPadding)
                     .fillMaxSize()
                     .statusBarsPadding()
                     .displayCutoutPadding()
+                    .navigationBarsPadding()
                     .imePadding(),
             ) {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt`
around lines 54 - 62, The Scaffold zeroes window insets via contentWindowInsets
= WindowInsets(0, 0, 0, 0) but you didn't reapply bottom system inset padding,
so add navigationBarsPadding() to the Modifier chain inside BoxWithConstraints
(where you already call .statusBarsPadding(), .displayCutoutPadding(),
.imePadding()) so the bottom navigation bar inset is reapplied and content won't
sit under persistent Android nav bars; update the Modifier used in
BoxWithConstraints to include .navigationBarsPadding() alongside the existing
padding modifiers.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt`:
- Around line 54-62: The Scaffold zeroes window insets via contentWindowInsets =
WindowInsets(0, 0, 0, 0) but you didn't reapply bottom system inset padding, so
add navigationBarsPadding() to the Modifier chain inside BoxWithConstraints
(where you already call .statusBarsPadding(), .displayCutoutPadding(),
.imePadding()) so the bottom navigation bar inset is reapplied and content won't
sit under persistent Android nav bars; update the Modifier used in
BoxWithConstraints to include .navigationBarsPadding() alongside the existing
padding modifiers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 342c5eb8-ac86-4fe3-8fb6-53087645a8a0

📥 Commits

Reviewing files that changed from the base of the PR and between 3258d35 and 188abed.

📒 Files selected for processing (1)
  • example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt

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.

1 participant