Skip to content

Conversation

@commonspider
Copy link
Contributor

@commonspider commonspider commented Oct 3, 2025

This PR implements a keyboard shortcuts system based on the structure of the clipboard system.
Different modes can be registered by the handler. The first enabled one, in order of priority, will handle keydown events.

Technical details

  • shortcuts.ts: holds the store and interface.
  • AppContext.svelte: initializes shortcutsHandler and sets the absolute priority of modes with a list of names.
  • TableView.svelte: instantiates SelectMode and EditMode and passes them to the Sheet.
  • Sheet.svelte: registers the two modes and enables SelectMode, only when it is focused.
  • CellWrapper.svelte: enables EditMode only when itself is in edit mode.
  • AppShortcutsHandler.ts: keeps tracks of modes and calls the correct one on keydown.
  • EditMode.ts: currently empty.
  • SelectMode.ts: calls the "Set to NULL" shortcut.
  • setNull.ts: implements the shortcut.

What's left

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the develop branch of the repository
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no
    visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@zackkrida
Copy link
Member

@commonspider would it be helpful for someone (likely @seancolsen) to review what you've done here so far?

@commonspider
Copy link
Contributor Author

@zackkrida Yes thank you. @seancolsen I've followed the structure of the clipboard system and changed it a little bit according to your description on Matrix. If my attempt is acceptable, I can do some tests and push a final version.
Also, should I use the function in your file setNull.ts as it is, or do I keep on implementing my own?

@seancolsen seancolsen self-assigned this Oct 7, 2025
@seancolsen seancolsen added the pr-status: review A PR awaiting review label Oct 7, 2025
@pavish pavish deleted the branch mathesar-foundation:context_menu October 10, 2025 06:07
@pavish pavish closed this Oct 10, 2025
@pavish
Copy link
Member

pavish commented Oct 10, 2025

Looks like GH automatically closed this PR since the context_menu branch was merged into develop (since merging a PR deletes the branch by default). The target branch should have automatically changed to develop but I'm not sure what went wrong.

@commonspider Could you please open a new PR with develop as the target branch?

@commonspider commonspider deleted the keyboard_shortcuts branch October 20, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-status: review A PR awaiting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants