Skip to content

Feat: developer's console#32

Merged
hugmouse merged 23 commits intomasterfrom
feat/developer-console
Mar 11, 2026
Merged

Feat: developer's console#32
hugmouse merged 23 commits intomasterfrom
feat/developer-console

Conversation

@hugmouse
Copy link
Owner

Just look at this - I'm copying even more features from web browsers. I wonder if I will copy even more. Anyway, built this mostly for logcat messages since they show when my app misbehaves and/or my code is bad.

hugmouse added 15 commits March 11, 2026 08:41
Add developerMode boolean to SettingsRepository, SettingsState, and
SettingsManager. Wire through FeatureCallbacks, BrowserCallbacksImpl,
BrowserViewModel, SettingsScreen, and DialogOrchestrator. The Logcat
tab in the console is gated behind this setting.
…d auto-scroll

ModalBottomSheet composable with tab-based filtering (All, Network,
Errors, Security, Logcat), search bar, clear button, auto-scroll
to latest entries, and logcat lifecycle management.
…wModel

Add ConsoleCallbacks interface, implement in BrowserCallbacksImpl,
instantiate ConsoleManager and LogcatReader in ViewModel before
GeminiClient, add Console item to toolbar dropdown menu.
…ycle callbacks

Wire console entries and error count through BrowserScaffold, add
ConsoleSheet between tab switcher and dialog orchestrator, expand
ConsoleCallbacks with dismiss/logcat lifecycle methods.
…composition

Move ConsoleSheet out of BrowserScaffold into a separate ConsoleOverlay
composable that reads consoleEntries/consoleErrorCount in its own
recomposition scope, preventing the entire screen from recomposing on
every new log entry.
Replace ModalBottomSheet with a docked ConsolePanel that sits at
the bottom of the content area, pushing gemtext content up like
Chrome DevTools. Panel has a drag handle for resizing between
100-500dp. Console state reads remain isolated in ConsoleContent
to avoid unnecessary recomposition.
Skip ViewRootImpl, Choreographer, OpenGLRenderer and other framework
tags that spam thousands of per-frame logs.
Tags like ViewRootImpl[MainActivity] weren't caught by exact match.
Switch to startsWith prefix matching. Also add InputMethodManager
and ImeTracker to the filter list.
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

Adds an in-app console and developer mode: new console data models and logger interface, console logging wired into network/trust manager, console UI and filtering, Logcat reader and ConsoleManager, developer-mode persistence and settings UI, plus callbacks and tests.

Changes

Cohort / File(s) Summary
Console Data Models & Logger
app/src/main/java/mysh/dev/gemcap/domain/ConsoleModels.kt, app/src/main/java/mysh/dev/gemcap/domain/ConsoleLogger.kt
New ConsoleEntry, ConsoleCategory, ConsoleLevel types and ConsoleLogger interface with NoOp instance.
Settings Persistence
app/src/main/java/mysh/dev/gemcap/data/SettingsRepository.kt
Adds persistent boolean developerMode (KEY_DEVELOPER_MODE) with getter/setter.
Network Layer Integration
app/src/main/java/mysh/dev/gemcap/network/GeminiClient.kt, app/src/main/java/mysh/dev/gemcap/network/TofuTrustManager.kt
Constructors now accept ConsoleLogger (default NoOp); key request/response/error and TOFU verification points log via consoleLogger.
Console UI Components
app/src/main/java/mysh/dev/gemcap/ui/console/ConsoleSheet.kt, app/src/main/java/mysh/dev/gemcap/ui/console/ConsoleEntryItem.kt, app/src/main/java/mysh/dev/gemcap/ui/console/ConsoleTabBar.kt, app/src/main/java/mysh/dev/gemcap/ui/console/LogcatFilterBar.kt, app/src/main/java/mysh/dev/gemcap/ui/console/ConsoleColors.kt
New composables: resizable console panel with tabs and filters, entry item with expandable details, tab bar (error badge), logcat level chips, and console colour palette.
UI Managers & Logcat
app/src/main/java/mysh/dev/gemcap/ui/managers/ConsoleManager.kt, app/src/main/java/mysh/dev/gemcap/ui/managers/LogcatReader.kt, app/src/main/java/mysh/dev/gemcap/ui/managers/SettingsManager.kt
New ConsoleManager implementing ConsoleLogger (bounded FIFO, entries, errorCount, show/dismiss, clear); LogcatReader parses logcat and emits to console; SettingsManager gains updateDeveloperMode.
UI State Holders
app/src/main/java/mysh/dev/gemcap/ui/model/UiStateHolders.kt
Adds PanelState.showConsole and SettingsState.developerMode fields (default false).
Browser Integration
app/src/main/java/mysh/dev/gemcap/ui/BrowserViewModel.kt, app/src/main/java/mysh/dev/gemcap/ui/BrowserScreen.kt
ViewModel wired with ConsoleManager/LogcatReader, exposes consoleEntries/consoleErrorCount and console control APIs; BrowserScreen/Scaffold render console panel when shown.
Settings UI & Callbacks
app/src/main/java/mysh/dev/gemcap/ui/SettingsScreen.kt, app/src/main/java/mysh/dev/gemcap/ui/callbacks/FeatureCallbacks.kt, app/src/main/java/mysh/dev/gemcap/ui/callbacks/BrowserCallbacksImpl.kt, app/src/main/java/mysh/dev/gemcap/ui/components/DialogOrchestrator.kt
SettingsScreen accepts developerMode and onDeveloperModeChange; SettingsCallbacks gains onDeveloperModeChange; new ConsoleCallbacks added; implementations wired to view model.
Toolbar / Control Bar
app/src/main/java/mysh/dev/gemcap/ui/components/ControlBar.kt, app/src/main/java/mysh/dev/gemcap/ui/components/controlBarComponents/ToolbarMenu.kt
Adds onConsoleClick parameter and menu item to toggle console from the toolbar menu.
Tests
app/src/test/java/mysh/dev/gemcap/domain/ConsoleModelsTest.kt, app/src/test/java/mysh/dev/gemcap/ui/managers/ConsoleManagerTest.kt, app/src/test/java/mysh/dev/gemcap/ui/managers/LogcatReaderTest.kt
New unit tests for console models, ConsoleManager behaviour (buffering, IDs, clear, panel state, filtering), and LogcatReader parsing/level mapping.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feat: developer's console' clearly and directly summarises the main feature being added — a developer console for debugging and monitoring app behaviour.
Description check ✅ Passed The description relates to the changeset, mentioning that the console was built to surface logcat messages when the app misbehaves, which aligns with the extensive console infrastructure changes throughout the PR.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/developer-console

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.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Mar 11, 2026
coderabbitai[bot]

This comment was marked as resolved.

@hugmouse hugmouse merged commit f5f92c4 into master Mar 11, 2026
2 checks passed
@hugmouse hugmouse deleted the feat/developer-console branch March 20, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant