Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reimplement cheatsheet using html #619

Merged
merged 9 commits into from
Jul 7, 2022

Conversation

pokey
Copy link
Member

@pokey pokey commented Mar 24, 2022

I have left the existing "cursorless help" intact for now, so we can see whether deploy works. This functionality is all self-contained, and accessible via a new command "cursorless reference"

Fixes #618
Fixes #630
Fixes #454
Fixes #505

Preview

Light mode

image

Dark mode

image

Mobile

image

Todo

  • Switch identifier to id
  • Rename data/cheatsheet
  • Change spokenForms to variations
  • Use camelcase for eg hat_color in json

@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch 10 times, most recently from 3f54c63 to 3c33f66 Compare May 4, 2022 22:38
@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch from 2a32cbb to f0ac1de Compare May 6, 2022 19:09
package.json Outdated
},
{
"command": "cursorless.showCheatsheet",
"title": "Cursorless: Resume test case recording"
Copy link
Collaborator

Choose a reason for hiding this comment

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

see title

@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch from f0ac1de to 82abc34 Compare May 9, 2022 19:07
@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch from 6ca3a35 to 913b7b1 Compare May 19, 2022 09:37
@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch 3 times, most recently from 4f859f6 to 9a0e0e8 Compare June 26, 2022 15:15
@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch 6 times, most recently from e50ded4 to 568c201 Compare July 5, 2022 17:19
@pokey pokey marked this pull request as ready for review July 5, 2022 18:48
@pokey pokey force-pushed the pokey/issue618-Reimplement-cheatsheet-using-html branch from 599a320 to 4c45de5 Compare July 6, 2022 14:07
@@ -3,7 +3,7 @@ dist
node_modules
.vscode-test/
*.vsix
package-lock.json
/package-lock.json
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah there's one in cursorless-nx subdir now. We'll merge things when we migrate to nx but for now just wanted to have a lock file in there

@pokey pokey merged commit 24af088 into main Jul 7, 2022
@pokey pokey deleted the pokey/issue618-Reimplement-cheatsheet-using-html branch July 7, 2022 14:35
cursorless-bot pushed a commit that referenced this pull request Jul 7, 2022
* Cheatsheet nx html generation

* HTML cheatsheet talon side

* HTML cheatsheet VSCode extension-side

* Tweak deploy

* identifier => id

* Tweaks from PR feedback

* Rename dir

* update defaults.json

* Remove nx-welcome.tsx
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this pull request Mar 27, 2024
* Cheatsheet nx html generation

* HTML cheatsheet talon side

* HTML cheatsheet VSCode extension-side

* Tweak deploy

* identifier => id

* Tweaks from PR feedback

* Rename dir

* update defaults.json

* Remove nx-welcome.tsx
github-merge-queue bot pushed a commit that referenced this pull request Jul 19, 2024
<img width="773" alt="image"
src="https://github.com/user-attachments/assets/ae0d024b-a810-4eab-add5-732f1171d9ef">



## Todo

- [x] Install locally and try everything out
- [x] Try "cursorless docs" both inside and outside of VSCode
- [x] I have not broken the cheatsheet
- [x] Make it more obvious that the tutorial list is a list of all
tutorials
- [x] Change what we show when tutorial prereqs no longer met, eg
"prereqs not met, feel free to keep playing, and say resume to resume"
- [x] Add note at end of unit 1 suggesting they continue to play with
the document
- [x] Tune tutorial content. Move / add docs tip to end of first
tutorial. More stuff maybe better for follow-up PR
- [x] Point out that we're using highlights for marks in first tutorial
step
- [x] Have "tutorial exit" command and corresponding button
- [x] Add paragraph break between sentences in step
- [x] Workshop the actual text in the editor itself so that it indicates
they should look at the side bar
- [x] Make color of commands stand out more
- [x] Properly support custom actions and other necessary custom spoken
forms
- [x] Store current progress in local storage (and sync it)
- [x] Properly support custom symbol spoken forms (eg alphabet)
- [x] Add "tutorial restart"
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] Fix scope tree view
- [x] How to handle disabled hat color?
- [x] Figure out unicode for emoji
- [x] Figure out what "cursorless tutorial" should actually do.
Currently starts second tutorial, which is obv not what we want
- [x] Figure out how to advance from last step of initial tutorial, as
it has no action to perform
- [x] Add "tutorial next" / "tutorial previous" commands
- [x] Add tutorial step saying to use "cursorless help" cheatsheat
- [x] Fix broken references to css eg reset
- [x] Invalidate state if custom spoken forms change
- [x] Change view when we detect that prereqs are no longer met (eg
cursor in wrong place, etc). Indicate they should say "tutorial
continue" / "tutorial restore" / "cursorless tutorial" to reset the
prereqs
- [x] Merge HUD changes
- [x] Figure out how to properly detect VSCode focused
- [x] Highlight marks that need to be targeted, so user doesn't have to
search for them
- [x] Remove print statements and commented out code from `tutorial.py`
- [x] Figure out how to only run step preparation when you have the
right window focused. Some of the time @pokey gets error message after
"cursorles help" step
<img width="385" alt="image"
src="https://github.com/cursorless-dev/cursorless/assets/755842/fc9bbcbd-111c-48e0-80b5-beeed8dafaea">
- [x] Open new window on start?
- [x] Ensure you're in the right window / editor before restoring state,
so we don't accidentally clobber something
- [x] Get it to work with mainline Talon HUD
- [x] Finish constructing spoken forms from commands
- [x] Use [app
name](https://github.com/pokey/cursorless-vscode/blob/a81dd0ce5f6359482fe9afc55a47ceb142cac17d/cursorless-talon/src/tutorial.py#L17)
for VSCode that works cross-platform
- [x] Figure out what todo with the fact that the cheatsheet clobbers
the entire screen and you can't even see the close button (#619)

See also cursorless-dev/cursorless-talon#143

### Unit 2

- Python
- Have an action class?

To cover:

- [x] New scope types
- [x] New actions, including
  - [x] single argument "bring"
  - [x] multiple argument "bring"
  - [x] "move"
  - [x] "swap"
- [x] Simple inference in the context of multiple target actions such as
swap or bring

### Extra unit

- [x] Probably want to move this into a new pull request
- [x] Create a json script for it
- [x] Don't forget to add the intermediate steps where it was not a
cursorless command and so isn't recorded

## Links

### Helpful places in our code base

-
https://github.com/cursorless-dev/cursorless/blob/main/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts
sets up file to initial state of tutorial step
- to generate a spoken form from the command payload in the yaml:
https://github.com/cursorless-dev/cursorless/blob/a9cc79f287a0278faf1198f9775cef6932630800/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts#L95
- this is where you'll send a command to cursorless requesting it to set
up initial tutorial step state and have it return generated spoken form:
https://github.com/cursorless-dev/cursorless/pull/360/files#diff-5c1cd9d422f7c8df0325fd0958446c90873fb338c462287ef5f57606a363658bR35-R37
- registering a new command extension-side
https://github.com/cursorless-dev/cursorless/blob/a9cc79f287a0278faf1198f9775cef6932630800/packages/cursorless-vscode/src/extension.ts#L125

### In case we decided to look into VSCode walkthroughs rather than
Talon hud

-
https://code.visualstudio.com/api/references/contribution-points#contributes.walkthroughs

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
cursorless-bot pushed a commit that referenced this pull request Jul 19, 2024
<img width="773" alt="image"
src="https://github.com/user-attachments/assets/ae0d024b-a810-4eab-add5-732f1171d9ef">



## Todo

- [x] Install locally and try everything out
- [x] Try "cursorless docs" both inside and outside of VSCode
- [x] I have not broken the cheatsheet
- [x] Make it more obvious that the tutorial list is a list of all
tutorials
- [x] Change what we show when tutorial prereqs no longer met, eg
"prereqs not met, feel free to keep playing, and say resume to resume"
- [x] Add note at end of unit 1 suggesting they continue to play with
the document
- [x] Tune tutorial content. Move / add docs tip to end of first
tutorial. More stuff maybe better for follow-up PR
- [x] Point out that we're using highlights for marks in first tutorial
step
- [x] Have "tutorial exit" command and corresponding button
- [x] Add paragraph break between sentences in step
- [x] Workshop the actual text in the editor itself so that it indicates
they should look at the side bar
- [x] Make color of commands stand out more
- [x] Properly support custom actions and other necessary custom spoken
forms
- [x] Store current progress in local storage (and sync it)
- [x] Properly support custom symbol spoken forms (eg alphabet)
- [x] Add "tutorial restart"
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] Fix scope tree view
- [x] How to handle disabled hat color?
- [x] Figure out unicode for emoji
- [x] Figure out what "cursorless tutorial" should actually do.
Currently starts second tutorial, which is obv not what we want
- [x] Figure out how to advance from last step of initial tutorial, as
it has no action to perform
- [x] Add "tutorial next" / "tutorial previous" commands
- [x] Add tutorial step saying to use "cursorless help" cheatsheat
- [x] Fix broken references to css eg reset
- [x] Invalidate state if custom spoken forms change
- [x] Change view when we detect that prereqs are no longer met (eg
cursor in wrong place, etc). Indicate they should say "tutorial
continue" / "tutorial restore" / "cursorless tutorial" to reset the
prereqs
- [x] Merge HUD changes
- [x] Figure out how to properly detect VSCode focused
- [x] Highlight marks that need to be targeted, so user doesn't have to
search for them
- [x] Remove print statements and commented out code from `tutorial.py`
- [x] Figure out how to only run step preparation when you have the
right window focused. Some of the time @pokey gets error message after
"cursorles help" step
<img width="385" alt="image"
src="https://github.com/cursorless-dev/cursorless/assets/755842/fc9bbcbd-111c-48e0-80b5-beeed8dafaea">
- [x] Open new window on start?
- [x] Ensure you're in the right window / editor before restoring state,
so we don't accidentally clobber something
- [x] Get it to work with mainline Talon HUD
- [x] Finish constructing spoken forms from commands
- [x] Use [app
name](https://github.com/pokey/cursorless-vscode/blob/a81dd0ce5f6359482fe9afc55a47ceb142cac17d/cursorless-talon/src/tutorial.py#L17)
for VSCode that works cross-platform
- [x] Figure out what todo with the fact that the cheatsheet clobbers
the entire screen and you can't even see the close button (#619)

See also cursorless-dev/cursorless-talon#143

### Unit 2

- Python
- Have an action class?

To cover:

- [x] New scope types
- [x] New actions, including
  - [x] single argument "bring"
  - [x] multiple argument "bring"
  - [x] "move"
  - [x] "swap"
- [x] Simple inference in the context of multiple target actions such as
swap or bring

### Extra unit

- [x] Probably want to move this into a new pull request
- [x] Create a json script for it
- [x] Don't forget to add the intermediate steps where it was not a
cursorless command and so isn't recorded

## Links

### Helpful places in our code base

-
https://github.com/cursorless-dev/cursorless/blob/main/packages/cursorless-vscode-e2e/src/suite/recorded.vscode.test.ts
sets up file to initial state of tutorial step
- to generate a spoken form from the command payload in the yaml:
https://github.com/cursorless-dev/cursorless/blob/a9cc79f287a0278faf1198f9775cef6932630800/packages/cursorless-engine/src/scopeProviders/ScopeInfoProvider.ts#L95
- this is where you'll send a command to cursorless requesting it to set
up initial tutorial step state and have it return generated spoken form:
https://github.com/cursorless-dev/cursorless/pull/360/files#diff-5c1cd9d422f7c8df0325fd0958446c90873fb338c462287ef5f57606a363658bR35-R37
- registering a new command extension-side
https://github.com/cursorless-dev/cursorless/blob/a9cc79f287a0278faf1198f9775cef6932630800/packages/cursorless-vscode/src/extension.ts#L125

### In case we decided to look into VSCode walkthroughs rather than
Talon hud

-
https://code.visualstudio.com/api/references/contribution-points#contributes.walkthroughs

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants