GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add keyboard shortcuts to the toolbar by mgstabrani · Pull Request #2534 · django-commons/django-debug-toolbar

Conversation

@mgstabrani

@mgstabrani mgstabrani commented Nov 21, 2026

Copy link
Copy Markdown
Member

Description

Add keyboard shortcuts to the toolbar. Details are:

  • ? opens a shortcuts dialog listing the available shortcuts.
  • g then a panel's shortcut letter opens that panel within one second.
  • ENABLE_KEYBOARD_SHORTCUTS (default True) disables the feature entirely.
  • Shortcuts are ignored while typing in input, textarea, select or contenteditable elements, and while Alt/Ctrl/Cmd is held.
Screen Record
Screen.Recording.2026-11-21.at.17.03.31.mov

Fixes #2414

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

AI/LLM Usage

  • This PR includes code generated with the help of an AI/LLM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

VeldaKiara reacted with eyes emoji
All reactions
  • 👀 1 reaction
mgstabrani added 11 commits November 15, 2026 17:07
@mgstabrani
feat: add panel keyboard shortcuts
f782a3b
@mgstabrani
feat: add ENABLE_KEYBOARD_SHORTCUTS config flag
b4f1e60
@mgstabrani
refactor: simplify active_shortcut_key and annotate shortcut_key
d0918ea
@mgstabrani
refactor: resolve panel shortcut keys on the toolbar
861dec5
@mgstabrani
docs: trim ENABLE_KEYBOARD_SHORTCUTS description
039e6e4
@mgstabrani
test: table-drive the shortcuts rendering test
a1346ce
@mgstabrani
refactor: simplify keyboard shortcut handling in toolbar.js
6601faf
@mgstabrani
Merge branch 'main' into 2414
557d35a
@mgstabrani
docs: simplify shortcut_key docstring
0e3a0de
@mgstabrani
refactor: simplify shortcuts dialog and keydown handling
131c189
@mgstabrani
docs: note keyboard shortcuts in the changelog
2d787c3
@github-actions

github-actions Bot commented Nov 21, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  debug_toolbar
  toolbar.py
  debug_toolbar/panels
  __init__.py
  alerts.py
  cache.py
  community.py
  headers.py
  profiling.py
  request.py
  settings.py
  signals.py
  staticfiles.py
  tasks.py
  timer.py
  versions.py
  debug_toolbar/panels/history
  panel.py
  debug_toolbar/panels/sql
  panel.py
  debug_toolbar/panels/templates
  panel.py
Project Total  

This report was generated by python-coverage-comment-action

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tim-schilling

tim-schilling commented Nov 21, 2026

Copy link
Copy Markdown
Member

@mgstabrani it may be worth taking a look at some of the other options the community has implemented to help with what to consider for the interface here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tim-schilling

tim-schilling commented Nov 21, 2026

Copy link
Copy Markdown
Member

I played around with it. It works nicely, though I think there are a few things we can do to help out.

  • Make some type of visual change to indicate "g" is the magic character to press for the shortcut menu
  • When "g" is typed, make it easier to discover what they should use next (ideas below)
    • Maybe reduce the panel buttons to just the titles and the button they need to press
    • Display a new panel content that shows the panels and the shortcut buttons
  • Consider adding the shortcut to the title attribute

The other weird thought I had was, what would it look like and what would it take to allow a user to switch to a different request with this tool? I think this is where the new panel content is a bit more friendlier. Being able to type g+h+<search for request path, args/kwargs> and then select the resulting request from there to update the panel's content could be pretty helpful.

Good work with this! I was worried it was going to be more JS at first, but it seems to be a reasonable amount.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tim-schilling tim-schilling mentioned this pull request Nov 21, 2026
Version 9.0.0 #2533
Open
1 of 3 tasks
@mgstabrani

mgstabrani commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

Thanks @tim-schilling, appreciate the feedback. I agree that the shortcut isn't very intuitive right now, and nothing really tells people it exists. I'll try to explore what you suggested.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add keyboard shortcuts to the toolbar

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mgstabrani @tim-schilling
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.