visualization-tool icon indicating copy to clipboard operation
visualization-tool copied to clipboard

Feat/toggle flags w cmd

Open noahonyejese opened this issue 10 months ago • 8 comments

What Changes? This PR adds a keyboard command handler in order to allow users to toggle the debug flag by entering toggledebug

How to test

  1. Go to this link
  2. enter toggledebug
  3. See how the url changes to have ?flag__debug=true

ps: @bprusinowski not sure if this the preferred approach, was pretty simple 15 min effort, not sure if it works on preview link

  • [x] Add a CHANGELOG entry

noahonyejese avatar Feb 11 '25 10:02 noahonyejese

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
visualization-tool ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 25, 2025 8:27am

vercel[bot] avatar Feb 11 '25 10:02 vercel[bot]

@bprusinowski currently it's always crtl + t + d also for mac, there should be no native binding to this for any browser and and operating system. Maybe it makes sense to consider your approach, but rather by @sosiology , @KerstinFaye since it's for them primarily?

noahonyejese avatar Feb 12 '25 14:02 noahonyejese

@noahonyejese I've also tried with ctrl, and it didn't work, maybe it's broken in Safari, or I'm doing something wrong 🥹 I personally feel like it should be something natural to remember, that's why I'd prefer to have a "memorable text" (as I also use debug mode often 😅), but if you can make sure it works across browsers, it's also fine 🤞

bprusinowski avatar Feb 12 '25 15:02 bprusinowski

@bprusinowski I see, generally it's maybe not working because of the enable condition? in _app.tsx not sure I thought that is the correct value to determine when to allow it?

The only downside to the text for me is that I never know how much I already typed 😅

noahonyejese avatar Feb 12 '25 15:02 noahonyejese

At the moment I'm not sure why it doesn't work, we'd need to investigate 🔍

bprusinowski avatar Feb 13 '25 08:02 bprusinowski

@bprusinowski I adjusted this to use konami

noahonyejese avatar Feb 17 '25 08:02 noahonyejese

@bprusinowski is there still something wrong here?

noahonyejese avatar Feb 25 '25 08:02 noahonyejese

@noahonyejese I believe the behavior should be that when user types toggledebug, the debug panel icon automatically shows. I see that the relevant part is added to the URL now, but you need to know about this, click on the URL, hit enter, and only then you actually have a debug panel visible 😄 Here I feel like it should only be necessary to enter the text, would it be possible to make it work like this? 🤔

PS. I think the CHANGELOG is wrong now, it still indicates the shortcut method 🔍

bprusinowski avatar Feb 25 '25 09:02 bprusinowski