Skip to content

[Example] Add an in-app console viewer#4313

Merged
j-piasecki merged 8 commits into
mainfrom
@jpiasecki/in-app-console
Jul 15, 2026
Merged

[Example] Add an in-app console viewer#4313
j-piasecki merged 8 commits into
mainfrom
@jpiasecki/in-app-console

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Jul 13, 2026

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings July 13, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.alert calls in example screens with console.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.

Comment thread apps/common-app/src/console/consoleLogs.ts
Comment thread apps/common-app/src/console/consoleLogs.ts Outdated
Comment thread apps/common-app/src/console/reactNativeLogBox.ts Outdated
Comment thread apps/common-app/App.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • onUpdate checks snapPointIndex (React state) inside a gesture callback. Because the gesture callbacks run on the UI thread, it’s safer to use snapPointIndexValue.value to 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;
      }

Comment thread apps/common-app/src/console/ConsoleModal.tsx
Comment thread apps/common-app/src/console/reactNativeLogBox.ts Outdated
Comment thread apps/common-app/src/console/consoleLogs.ts
Comment thread apps/common-app/src/new_api/showcase/bottom_sheet/index.tsx Outdated
@j-piasecki j-piasecki marked this pull request as ready for review July 14, 2026 06:31

@m-bert m-bert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

Comment thread apps/common-app/src/console/consoleLogs.ts Outdated
Comment thread apps/common-app/src/console/consoleLogs.ts Outdated
Comment thread apps/common-app/index.ts Outdated
j-piasecki and others added 3 commits July 14, 2026 12:31
Co-authored-by: Michał Bert <63123542+m-bert@users.noreply.github.com>
@j-piasecki j-piasecki requested a review from m-bert July 14, 2026 11:28
@j-piasecki j-piasecki merged commit 98cb1e7 into main Jul 15, 2026
3 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/in-app-console branch July 15, 2026 05:51
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.

3 participants