Skip to content

feat: keyboard shortcut to toggle sidebar#2343

Open
hirehamir wants to merge 1 commit into
rust-lang:masterfrom
hirehamir:feat/keyboard-shortcut-to-toggle-sidebar
Open

feat: keyboard shortcut to toggle sidebar#2343
hirehamir wants to merge 1 commit into
rust-lang:masterfrom
hirehamir:feat/keyboard-shortcut-to-toggle-sidebar

Conversation

@hirehamir
Copy link
Copy Markdown
Contributor

closes #2342.

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 22, 2024
Copy link
Copy Markdown
Contributor Author

@hirehamir hirehamir left a comment

Choose a reason for hiding this comment

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

I would have liked to do this in https://github.com/rust-lang/mdBook/blob/master/src/theme/book.js#L443, but for some reason this keyboard shortcut wasn't working there, while the click handler worked without issue.

@hirehamir
Copy link
Copy Markdown
Contributor Author

@Dylan-DPC I tried to do this in a cleaner way with hirehamir@a7da1d0, but document.addEventListener("keydown", function (event) { wasn't working with that commit, while clicking still toggled the sidebar without issue.

@rustbot

This comment has been minimized.

@hirehamir hirehamir force-pushed the feat/keyboard-shortcut-to-toggle-sidebar branch 2 times, most recently from 1d44c61 to 1dda4d3 Compare May 10, 2025 22:55
@hirehamir hirehamir force-pushed the feat/keyboard-shortcut-to-toggle-sidebar branch from 1dda4d3 to e744bc2 Compare May 10, 2025 22:59
@hirehamir
Copy link
Copy Markdown
Contributor Author

With this change

With this pull request, users would be able to collapse, and expand, the sidebar with just their keyboard.

2025-05-10_15.59.49.mp4

@hirehamir
Copy link
Copy Markdown
Contributor Author

@ehuss are there any changes you'd like me to make here?

I fixed the merge conflicts.

It's been around 414 days or so since I opened this pull request. I'm hoping we can get it across the finish line.

@hirehamir
Copy link
Copy Markdown
Contributor Author

@y21 would you happen to know how I can get feedback from ehuss?

I think this feature could make life easier for a lot of mdBook users. I'm trying to avoid running into merge conflicts again.

@y21
Copy link
Copy Markdown
Member

y21 commented May 18, 2025

Sorry, I don't know about the reviewing process in this repo here, usually (at least in clippy and the Rust repo) the standard wait time is 14 days, at which point a reviewer can be rerolled with r? team.
But it looks like this repo only has two maintainers, and it seems there's quite a few other PRs waiting on feedback, too.

This does look like a useful feature though 👍

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Aug 18, 2025

☔ The latest upstream changes (possibly 21f2435) made this pull request unmergeable. Please resolve the merge conflicts.

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

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a keyboard shortcut to toggle the sidebar

3 participants