Skip to content

feat(demo): Update sample app#10

Merged
komodgn merged 1 commit into
developfrom
feature/editor-demo
May 13, 2026
Merged

feat(demo): Update sample app#10
komodgn merged 1 commit into
developfrom
feature/editor-demo

Conversation

@komodgn
Copy link
Copy Markdown
Owner

@komodgn komodgn commented May 13, 2026

  • Add CodeEditor sample.

Summary by CodeRabbit

  • New Features

    • Added multi-component demo switching capability with a new top bar selector.
    • Introduced theme toggle control integrated into the demo interface.
  • Style

    • Enhanced preview section headers with improved styling and consistent typography.
    • Refined layout spacing and visual organization across demo views.

Review Change Stack

- Add CodeEditor sample.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR adds a demo component-switching system to the example app. A new DemoComponent enum defines available demo modes (CODE_VIEW and CODE_EDITOR). DemoTopBar provides a themed top bar with theme toggle and component selection via FilterChips. App() now manages component selection state and uses a new MainContent composable to route between demo views. CodeEditorSection is introduced for the standalone editor mode, and existing sections receive consistent Material Design typography and spacing updates.

Changes

Demo Component Selection and Navigation

Layer / File(s) Summary
DemoComponent enum definition
example/src/commonMain/kotlin/io/github/komodgn/example/DemoComponent.kt
DemoComponent enum with CODE_VIEW and CODE_EDITOR entries establishes the contract for available demo modes.
DemoTopBar composable for theme and component selection
example/src/commonMain/kotlin/io/github/komodgn/example/component/DemoTopBar.kt
DemoTopBar renders a themed top bar with theme toggle IconButton on the right and a FilterChip row that iterates over DemoComponent.entries, highlighting the selected component and notifying selection via callback.
Application state and content routing
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
App() manages selectedComponent state, renders DemoTopBar, and delegates content rendering to a new MainContent composable that conditionally renders either the code-view/editor split screen (CODE_VIEW) or the standalone code editor (CODE_EDITOR), while preserving language and code-change wiring.
CodeEditorSection and section UI refinements
example/src/commonMain/kotlin/io/github/komodgn/example/section/CodeEditorSection.kt, example/src/commonMain/kotlin/io/github/komodgn/example/section/CodeViewSection.kt, example/src/commonMain/kotlin/io/github/komodgn/example/section/EditorSection.kt
CodeEditorSection is added for the standalone editor mode with preview header and language selection. CodeViewSection and EditorSection preview headers are updated with consistent MaterialTheme.typography.titleMedium styling and explicit spacing via Spacer.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • komodgn/compose-codeview#9: Adds the CodeEditor composable that CodeEditorSection depends on for the standalone editor mode.
  • komodgn/compose-codeview#1: Previously refactored Application.kt to restructure the example app UI composition; this PR builds on that foundation to add component routing.

Poem

🐰 A rabbit hops through demo modes,
Switching views where logic flows,
Code editor standalone, or split with preview bright,
With theme toggles and chip selections shining light,
Material Design squared—compose in sight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat(demo): Update sample app' is vague and generic, using the non-descriptive phrase 'Update sample app' that doesn't convey the specific nature of the changes (adding CodeEditor demo and refactoring component selection). Consider a more specific title like 'feat(demo): Add CodeEditor demo component and DemoTopBar' or 'feat(demo): Refactor app with component selection UI' to better reflect the main changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/editor-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.

@komodgn komodgn merged commit 7ab0317 into develop May 13, 2026
1 check was pending
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