Skip to content

Feature/line numbers#7

Merged
komodgn merged 4 commits into
developfrom
feature/line-numbers
May 11, 2026
Merged

Feature/line numbers#7
komodgn merged 4 commits into
developfrom
feature/line-numbers

Conversation

@komodgn
Copy link
Copy Markdown
Owner

@komodgn komodgn commented May 11, 2026

Summary by CodeRabbit

  • New Features

    • Added line numbers display in code view (enabled by default).
    • Introduced dark/light theme toggle to the app.
  • Documentation

    • Updated parameter documentation for CodeView and related components.
  • Style

    • Enhanced visual distinction for selected languages in dropdown menu.
    • Improved theme color system with cohesive dark and light mode palettes.
    • Refined text field styling with theme-aware colors.
    • Adjusted spacing and padding for better visual balance.

Review Change Stack

komodgn added 4 commits May 11, 2026 23:21
- Define centralized color palettes in Color.kt for consistent styling.
- Integrate CodeViewTheme with support for dynamic dark/light mode switching.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da8e22db-2d60-42e0-8c2f-b7faf03f973d

📥 Commits

Reviewing files that changed from the base of the PR and between 64e958f and b3e5ffa.

📒 Files selected for processing (14)
  • README.md
  • codeview/compose/src/commonMain/kotlin/io/github/komodgn/codeview/compose/CodeView.kt
  • docs/codeview/overview.md
  • example/src/androidMain/kotlin/io/github/komodgn/example/Platform.android.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/Platform.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/component/LanguageDropDown.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/section/EditorSection.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/theme/CodeViewTheme.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/theme/Color.kt
  • example/src/commonMain/kotlin/io/github/komodgn/example/util/SampleCode.kt
  • example/src/iosMain/kotlin/io/github/komodgn/example/Platform.ios.kt
  • example/src/jsMain/kotlin/io/github/komodgn/example/Platform.js.kt
  • example/src/wasmJsMain/kotlin/io/github/komodgn/example/Platform.wasmJs.kt

📝 Walkthrough

Walkthrough

This PR adds dark/light theme support and line numbers rendering to the CodeView library. It introduces a Material3 color scheme system with configurable dark mode, platform-specific theme implementations (Android window insets, iOS/JS/WASM stubs), and updates the core CodeView composable to conditionally render a line-number gutter alongside the syntax-highlighted code area.

Changes

Dark Mode & Line Numbers Support

Layer / File(s) Summary
Color Definitions
example/src/commonMain/kotlin/io/github/komodgn/example/theme/Color.kt
New file introduces dark and light mode color constants (Grey900, Grey800, SkyBlue, BrightRed, etc.) and derives code-theme aliases (CodeBackground, CodeSurface, CodeTextPrimary, etc.) for each variant.
Platform Theme Contract
example/src/commonMain/kotlin/io/github/komodgn/example/Platform.kt
PlatformColors expect function updated to be a Composable that accepts isDarkTheme: Boolean, establishing the contract for platform-specific theme handling.
Theme Composition & Color Schemes
example/src/commonMain/kotlin/io/github/komodgn/example/theme/CodeViewTheme.kt
CodeViewTheme now defines DarkColors and LightColors using Material3 color schemes, accepts isDarkTheme parameter (defaults to system dark theme), and applies the selected colorScheme to MaterialTheme.
Platform-Specific Implementations
example/src/androidMain/kotlin/io/github/komodgn/example/Platform.android.kt, example/src/iosMain/kotlin/io/github/komodgn/example/Platform.ios.kt, example/src/jsMain/kotlin/io/github/komodgn/example/Platform.js.kt, example/src/wasmJsMain/kotlin/io/github/komodgn/example/Platform.wasmJs.kt
Android implementation uses WindowCompat to set isAppearanceLightStatusBars and isAppearanceLightNavigationBars based on theme. iOS, JS, and WASM implementations are stubs.
CodeView Line Numbers
codeview/compose/src/commonMain/kotlin/io/github/komodgn/codeview/compose/CodeView.kt, README.md, docs/codeview/overview.md
CodeView adds showLineNumbers parameter (default true), restructures layout into a Row with optional line-number gutter (1..lineCount) and scrollable code area. Documentation updated to reflect new parameter.
App Integration & Theme Toggle
example/src/commonMain/kotlin/io/github/komodgn/example/Application.kt
App composable now includes theme toggle state (rememberSaveable), Scaffold topBar with theme switch IconButton, and applies safe window insets (safeDrawing via windowInsetsPadding) and MaterialTheme background color.
Component Styling Updates
example/src/commonMain/kotlin/io/github/komodgn/example/component/LanguageDropDown.kt, example/src/commonMain/kotlin/io/github/komodgn/example/section/EditorSection.kt
LanguageDropDown highlights selected language in primary color with bold weight. EditorSection uses MaterialTheme.colorScheme colors for text field styling instead of hardcoded blue.
Sample Code Formatting
example/src/commonMain/kotlin/io/github/komodgn/example/util/SampleCode.kt
getInitialCode refactored to expression-bodied function (= when); code snippet templates reformatted for consistent whitespace.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • komodgn/compose-codeview#1: Prior PR modified CodeView API to add fontFamily parameter; this PR adds showLineNumbers and adjusts layout, continuing the CodeView.kt feature expansion.

Poem

🐰 A theme system blooms in shades of night and day,
Line numbers dance in ordered bright array,
Platform-specific colors paint each screen,
Dark and light harmonize in Material's dream! ✨

✨ 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/line-numbers

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 1c9b487 into develop May 11, 2026
1 check was pending
@komodgn komodgn deleted the feature/line-numbers branch May 11, 2026 15:15
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