Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggleable debug console on mobile in local/dev/stage #1371

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Mar 20, 2024

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Describe this PR

  • Minor improvement to DX and frontend debugging.
  • Add a toggleable debugging console, that displays the output of the console.
  • Helpful on mobile, when it's not easy to bring up browser debug tools.

Screenshots

Menu
image

Console
image

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock added priority:low Backlog of tasks that will be addressed in time frontend Related to frontend code labels Mar 20, 2024
@spwoodcock spwoodcock self-assigned this Mar 20, 2024
@github-actions github-actions bot added the devops Related to deployment or configuration label Mar 20, 2024
Copy link
Contributor

@NSUWAL123 NSUWAL123 left a comment

Choose a reason for hiding this comment

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

This can be very very helpful in debugging

@spwoodcock
Copy link
Member Author

It's not ready yet! I was hoping you could give me a hand making the console log actually display in the box 😁 Do you have any ideas?

We can look at it this afternoon otherwise πŸ‘

@NSUWAL123
Copy link
Contributor

@spwoodcock, the logs are being displayed on the box. I tried in both mobile and laptop browsers.
1711103046461_720
image

Note:
Instead of using: setLogs((prevLogs) => [...prevLogs, args.join(' ')]);

use JSON.stringify for the arguments of object type:

setLogs((prevLogs) => [
          ...prevLogs,
          args.map((arg) => (typeof arg === 'object' ? JSON.stringify(arg) : arg)).join(' '),
]);

as it is currently displaying [object object] for args of type object

@spwoodcock spwoodcock marked this pull request as ready for review March 22, 2024 14:02
@spwoodcock spwoodcock merged commit 5e6e245 into development Mar 22, 2024
3 checks passed
@spwoodcock spwoodcock deleted the feat/debug-console branch March 22, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Related to deployment or configuration frontend Related to frontend code priority:low Backlog of tasks that will be addressed in time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants