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

Fix enterProgram shortcut on control nodes #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

anderium
Copy link
Contributor

I accidentally based this on #41, if that is not accepted this should be cherry picked to only commit 947f0a9.
Only changes packages/app-web/src/slices/blueprint/index.ts

The node type for the enterProgram shortcut (enter/cmd+down) was not checked, because programId was assumed to be undefined for non-program nodes. It is actually also used by control nodes. This commit adds a double check that you actually use the shortcut on a program node.

console error

In this example I show that entering a program with keyboard shortcut meta+down is possible, but this also tries to enter the non-existent program defined by the control node programId. You can see the program crashes because everything disappears, “everything” being the node and the “explore” message.

example.mov

…ixes wierkstudio#40)

Base64 embeds bytes into 6 bit units. It takes two units to properly encode a single byte. If you then decode this, you can conclude that the 4 additional bits contain no information. (Unless the input violates our assumption that it is a base64 encoding.)

You can conclude that if $y = \lceil xs_{input} / s_{output}\rceil$ with x an integer, then $x <= \lfloor ys_{output} / s_{input}\rfloor$. This commit checks every added unit if it is the last, and doesn't add the null byte if it is. It might be more efficient to just use the larger array and slice off the null byte when it exists.

It can be impossible to determine a true zero byte from padding if `inputSize < outputSize`, but for binary-to-text that requires an alphabet of more than 256 characters.

Signed-off-by: anderium <33520919+anderium@users.noreply.github.com>
The node type for the enterProgram shortcut (enter/cmd+down) was not checked, because `programId` was assumed to be undefined for non-program nodes. It is actually also used by control nodes. This commit adds a double check that you actually use the shortcut on a program node.
@anderium anderium changed the title Shortcut enter program controls Fix enterProgram shortcut on control nodes Oct 23, 2024
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