Skip to content

feat(troubleshooting): Stack Usage section with periodic polling (zmk-module-devtool)#113

Merged
cormoran merged 1 commit into
mainfrom
claude/devtool-stack-usage
Jul 12, 2026
Merged

feat(troubleshooting): Stack Usage section with periodic polling (zmk-module-devtool)#113
cormoran merged 1 commit into
mainfrom
claude/devtool-stack-usage

Conversation

@cormoran

Copy link
Copy Markdown
Owner

Summary

  • Adds a Stack Usage card to the Troubleshooting page that connects to the cormoran__devtool custom subsystem (zmk-module-devtool PR #9) and polls per-thread stack high-water marks
  • Drains all cursor-paginated pages of get_stack_usage and visualises results as colour-coded progress bars sorted by usage (green → yellow → amber → red at 60/80/90%)
  • Auto-refresh toggle with 1 s / 3 s / 5 s / 10 s interval selector
  • Collapsed-header summary badge shows worst-case usage at a glance
  • Registers cormoran__devtool in the "Already supported" set on the Custom Subsystems page

New files:

  • proto/cormoran/devtool/devtool.proto — minimal proto covering only get_stack_usage (field 17/18 to match firmware wire format)
  • src/proto/cormoran/devtool/devtool.ts — generated TypeScript
  • src/hooks/useDevtoolStackUsage.ts — hook with pagination + polling
  • src/components/troubleshooting/DevtoolStackUsageSection.tsx — UI component

Depends on: zmk-module-devtool PR #9 being merged and CONFIG_ZMK_DEVTOOL_STACK_USAGE=y in firmware. Without it, the RPC returns an error which is displayed in the section (not available state is handled gracefully).

Test plan

  • Build passes (npm run build)
  • Type check passes (npx tsc -b --noEmit, no new errors)
  • Lint passes (npm run lint)
  • Connect a keyboard with CONFIG_ZMK_DEVTOOL_STACK_USAGE=y — Stack Usage section shows threads with progress bars
  • Enable Auto-refresh at 1s interval — bars update in real time
  • Connect keyboard without the Kconfig — section shows error message from RPC
  • Without cormoran__devtool subsystem — section shows "Not available" notice

🤖 Generated with Claude Code

Adds a "Stack Usage" card to the Troubleshooting page that polls
cormoran__devtool (zmk-module-devtool PR #9) for per-thread stack
high-water marks and visualises them with colour-coded progress bars.

- proto/cormoran/devtool/devtool.proto — minimal proto covering only
  get_stack_usage (request field 17, response field 18) to match the
  firmware wire format without pulling in the full devtool proto
- useDevtoolStackUsage hook — drains all paginated pages, exposes
  isPolling / pollIntervalMs / setPolling / setPollIntervalMs so the
  UI can auto-refresh on a 1/3/5/10 s interval
- DevtoolStackUsageSection component — per-thread progress bars (green
  → amber → red at 60/80/90 %), auto-refresh toggle with interval
  picker, collapsed-header summary badge
- Registers cormoran__devtool in the CustomSubsystemsPage supported set
- Japanese translations for all new strings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Cloudflare Workers Preview

Preview URL: https://423e4c7a-dya-studio-dev.cormoran707.workers.dev

Deployed from commit 2506d22

@cormoran cormoran merged commit 0c95a3c into main Jul 12, 2026
3 checks passed
@cormoran cormoran deleted the claude/devtool-stack-usage branch July 12, 2026 16:43
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.

1 participant