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

[POC] end-user-programming "REPL" exploration #233

wants to merge 1 commit into
base: master
Choose a base branch


Copy link

This PR is proof-of-concept for REPL for connecting from laptop sidecar machine to running capstone instance.

Basic running: install, restart capstone, and then (on sidecar machine):

$ cd src/apps/repl-cli
$ ./capstone-cli "capstone://Workspace/..." # grab the workspace from running capstone instance

Welcome to Capstone CLI [hash]

You can now execute one-off commands within the Capstone env:

# not too exciting
>>> 2 + 2

# dump the current store state
{ ... }

# snap all cards to grid
>>> Content.once(Content.rootBoardUrl, change => change(doc => {
    Object.keys( => {
      const snap = 100[key].x = Math.round([key].x / snap) * snap[key].y = Math.round([key].y / snap) * snap

    return doc

I'm also experimenting with idea of hooks to attach behaviours, the only existing hook right now is hooks.onCardDragEnded but this allows us to have snap-to-grid happen after each drag is completed (hook is execute within doc.change context so we can update card directly):

>>> hooks.onCardDragEnded = (card) => {
  const snap = 100
  card.x = Math.round(card.x / snap) * snap
  card.y = Math.round(card.y / snap) * snap

Putting this out so you can play with it before Friday's show&tell where I hope to demo this functionality and share some notes.

This probably shouldn't be merged.

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

Successfully merging this pull request may close these issues.

None yet

1 participant