[Example] Add an in-app console viewer#4313
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-app console log viewer to the apps/common-app example, intercepting console.* calls and presenting recent log entries in a bottom sheet UI (while still forwarding logs to the real console).
Changes:
- Replaces a few
alert/window.alertcalls in example screens withconsole.info(...)so output appears in the new viewer. - Introduces a console interception/store (
consoleLogs.ts) and a bottom-sheet UI (ConsoleLogSheet.tsx) to display recent logs and unread counts. - Updates the example app root layout to reserve space for the console sheet and hides it when React Native LogBox is visible.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/common-app/src/new_api/components/swipeable/index.tsx | Switches row press feedback from alert to console.info. |
| apps/common-app/src/new_api/components/swipeable/AppleStyleSwipeableRow.tsx | Switches right action press feedback from alert to console.info. |
| apps/common-app/src/new_api/complicated/camera/index.tsx | Replaces placeholder alerts with console.info. |
| apps/common-app/src/console/reactNativeLogBox.web.ts | Web stub for observing LogBox visibility. |
| apps/common-app/src/console/reactNativeLogBox.ts | Dev-only observer wiring into RN LogBox internal data. |
| apps/common-app/src/console/index.ts | Public barrel exports for the console feature. |
| apps/common-app/src/console/ConsoleLogSheet.tsx | Bottom-sheet UI to render captured logs and unread badge. |
| apps/common-app/src/console/consoleLogs.ts | Console interception, formatting, storage, and subscription utilities. |
| apps/common-app/index.ts | Ensures console module is loaded early for interception. |
| apps/common-app/App.tsx | Integrates the console sheet into the example app layout and safe-area setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
apps/common-app/src/new_api/showcase/bottom_sheet/index.tsx:87
onUpdatecheckssnapPointIndex(React state) inside a gesture callback. Because the gesture callbacks run on the UI thread, it’s safer to usesnapPointIndexValue.valueto avoid stale state during quick drags/snaps.
onUpdate: (e) => {
// when bottom sheet is not fully opened scroll offset should not influence
// its position (prevents random snapping when opening bottom sheet when
// the content is already scrolled)
if (snapPointIndex === 0) {
translationY.value = e.translationY - scrollOffset.value;
} else {
translationY.value = e.translationY;
}
m-bert
reviewed
Jul 14, 2026
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
m-bert
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a console write interceptor and an in-app console viewer using it. The logs are still appearing in the actual console.
Test plan
Example app
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-13.at.14.57.54.mov