Skip to content

Fix DevTools: show re-enable hint when 'Don't start DevTools' is selected - #1170

Open
Akhil Gupta (akhil9tiet) wants to merge 13 commits into
microsoft:mainfrom
akhil9tiet:fix/1148-devtools-off-hint
Open

Akhil Gupta (akhil9tiet) wants to merge 13 commits into
microsoft:mainfrom
akhil9tiet:fix/1148-devtools-off-hint

Conversation

@akhil9tiet

Copy link
Copy Markdown

What and why

Choosing Don't start DevTools in the toolbar's "WHEN THE APP STARTS" menu left no visible hint about how to turn DevTools back on — the only hint was a hover tooltip on the radio button. Now a short visible line appears under the start-mode options while "Don't start DevTools" is selected: "DevTools is off. To turn it back on, run winapp config set run.devtools on, or launch with winapp run . --devtools on."

Fixes #1148

Before / after

Before: the "Don't start DevTools" radio's only hint was its hover tooltip ("Turn DevTools back on with: winapp config set run.devtools on").
After: a visible line under the three start-mode radios reads "DevTools is off. To turn it back on, run winapp config set run.devtools on, or launch with winapp run . --devtools on.", shown only while "Don't start DevTools" is selected. (No screenshot; the UI is Windows-only. The new contract checks in toolbar-tests.cpp assert the hint text and the visibility wiring.)

Not tested / risks

Could not run the native UI on Linux. The two new toolbar-tests.cpp contract checks assert the hint text and visibility wiring; CI runs them on Windows.

Checklist

  • Tests added or updated
  • Tested locally on Windows

Copilot AI balanced review requested due to automatic review settings October 23, 2026 00:22
Comment thread src/winapp-devtools/test/toolbar-tests.cpp 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.

🟡 Changes recommended

Selecting Off closes the menu containing the hint, leaving the instructions hidden until the user reopens it.

1 open issue
What changed in this PR

This PR addresses #1148 by adding visible instructions for re-enabling DevTools beneath the toolbar’s startup options.

Changes:

  • Adds a hint with both configuration and launch commands.
  • Shows the hint when the saved startup mode is Off.
  • Adds source-contract checks for the hint text and visibility wiring.
File Description
src/​winapp-devtools/​test/​toolbar-tests.cpp Checks hint text and visibility wiring.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​xaml/​toolbar.xaml Adds the initially collapsed re-enable hint.
src/​winapp-devtools/​native/​WinApp.DevTools.Native/​DevToolsOverlay.Toolbar.inc Updates hint visibility with the startup selection.

Review effort: Balanced

@zateutsch Zach Teutsch (zateutsch) 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.

🤖 AI-generated review (winappcli pr-review skill) — verify before acting.

Users still don't see the hint when they pick "Don't start DevTools"

  • What is wrong: SetDefaultMode calls CloseToolbarMenu() before SetStartModeUi("off") makes the hint visible. The hint is inside that menu, so it is hidden as soon as it appears.
  • Show me: Open More and click "Don't start DevTools". The menu closes and no hint is shown. Expected: the re-enable line is visible. The hint only appears if the user reopens More during the same run. On later runs DevTools is off, so there is no toolbar, and winapp run prints nothing about it (DefaultDevToolsLine returns null for off).
  • Why it matters: The problem in #1148 is still there for anyone who picks the option and moves on.
  • Smallest fix: In OnStartOffClick, call ToggleToolbarMenu(L"DevToolsMoreMenu", L"DevToolsProtoMore", L"DevToolsStartOff") after SetDefaultMode("off"). This reopens the menu and sizes and places it with the hint showing. Only removing CloseToolbarMenu() would make the menu overlap the bar when the toolbar sits at the bottom. This matches the existing Copilot inline comment.

Optional: The new tests search the source for strings, so they pass even with this bug. A check that the hint's menu is still visible after clicking "Don't start DevTools" would catch it.

What was run: scripts\test-native-units.ps1 passed, including the two new toolbar checks. The live UI click path was not exercised.

@akhil9tiet

Copy link
Copy Markdown
Author

🤖 AI-generated review (winappcli pr-review skill) — verify before acting.

Users still don't see the hint when they pick "Don't start DevTools"

  • What is wrong: SetDefaultMode calls CloseToolbarMenu() before SetStartModeUi("off") makes the hint visible. The hint is inside that menu, so it is hidden as soon as it appears.
  • Show me: Open More and click "Don't start DevTools". The menu closes and no hint is shown. Expected: the re-enable line is visible. The hint only appears if the user reopens More during the same run. On later runs DevTools is off, so there is no toolbar, and winapp run prints nothing about it (DefaultDevToolsLine returns null for off).
  • Why it matters: The problem in [Bug]: "Don't start DevTools" gives no hint about how to turn DevTools back on #1148 is still there for anyone who picks the option and moves on.
  • Smallest fix: In OnStartOffClick, call ToggleToolbarMenu(L"DevToolsMoreMenu", L"DevToolsProtoMore", L"DevToolsStartOff") after SetDefaultMode("off"). This reopens the menu and sizes and places it with the hint showing. Only removing CloseToolbarMenu() would make the menu overlap the bar when the toolbar sits at the bottom. This matches the existing Copilot inline comment.

Optional: The new tests search the source for strings, so they pass even with this bug. A check that the hint's menu is still visible after clicking "Don't start DevTools" would catch it.

What was run: scripts\test-native-units.ps1 passed, including the two new toolbar checks. The live UI click path was not exercised.

Fixed in 97b8b4a — OnStartOffClick now reopens the start-mode menu after SetDefaultMode("off") so the re-enable hint is visible, matching the suggested ToggleToolbarMenu call. One open question: on later runs DevTools is off so there is no toolbar/menu at all — winapp run printing the hint would need a separate change; happy to follow your call on whether that belongs in this PR.

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.

[Bug]: "Don't start DevTools" gives no hint about how to turn DevTools back on

3 participants