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

Create a web app version #6

Open
2 tasks
jkomoros opened this issue Jun 17, 2023 · 1 comment
Open
2 tasks

Create a web app version #6

jkomoros opened this issue Jun 17, 2023 · 1 comment

Comments

@jkomoros
Copy link
Owner

jkomoros commented Jun 17, 2023

  • Single user GUI
  • Multi-user hosted version (possibly proprietary)
@jkomoros
Copy link
Owner Author

jkomoros commented Aug 6, 2023

The complex schema checking appears to be broken in VSCode, so #7 basically doesn't work right now, it's not obvious how to make it work, it's clear the recursive/large schema checking is falling off some cliff. It looks like other folks are having issues with adjacent problems too, e.g. microsoft/vscode#177142 , so maybe over the next few months it will clean itself up?

But for now the editing experience is about 100x harder without schema checking and intellisense to guide you through the names of different types and what arguments they expect.

That implies that the importance of a web app editing experience is much more important.

To start, just do a very very simple webapp that allows you to edit a packet in localstorage and copy/paste it.

  • Initial commit of webapp should be a slimmed down version of adjacency-map webapp portions
  • Strict seed type typing
  • Warn on individual properties that are invalid on seed type (not just overall, and overall should only show for ones that won't show up on a given property)
  • First run experience
  • Get packaging for deployment working
  • Have a notion of un-user-selectable versions (like load packets), that modify the last state in place with no message. (Actually just change it to blow away previous history, those only happen in specific loading contexts)
  • AppProfile should use the multiLine option to show a textarea instead
  • input seed_type should have an optional boolean multiLine
  • input seed type should allow not just string choices but sub-objects that are detailedChoice too. (validate with the choiceArray zod type)
  • PropertyShape should have an innerShape for array. and innerPropertiesShape (Record<string, PropertyShape>) for objects
  • Shouldn't getPacket() have a WrappedPacket | undefined signature? (And why wasn't typescript complaining?)
  • Fields with a newline in them should render a textArea.
  • use multiLineString for more arguments
  • When you undo a create packet/fork packet event, the currentPacket, currentPacketType gets stuck on a non-existence seed.
  • Add human readable descriptiosn of each undo state and show in UI. (Part of Add undo/redo to webapp #65)
  • Audit uses of textOrArray in seed type, because there are some that shouldnt' take an array, and SHOULD take an embedding
  • PropertyShape should get an innerType for arrays and objects (For objects it will need a different type per key, only if allowedType == key) And use it in value-editor of sub-properties
  • Bug: textarea edits don't actually get stored
  • Make it so input option is an options object (and then allow multiLine)
  • make sure that ts-lit-plugin is in strict mode (e.g. warn for unknown properties, warn for unimported templates, etc) (and verify it's actually working. Apparently plugins needs to go in compilerOptions?)
  • make it so the textArea extends downwards, not upwards
  • Allow downloading all packets as a zip file (include timestamp, allowing easy backup)
  • moveProperty should also only be a single action, not a DELETE/CHANGE which shows up in undo stack as two items.
  • value-editor should render description itself from propShape (maybe?).
  • value-editor should get a default value based on propertyShape (which is expecially helfpul for e.g. arrayType.return)
  • Make a single FORK_PACKET action (now that the undo state is visible to users, the multi-state action is incorrect)
  • When an unknown referenced packet is seen, automatically import the packet (or ask?)
  • Get rid of all of the different CurrentPacket event types and just have one
  • A confirm seed_type
  • When no API keys set, the error goes to console but is not caught by the Calculation. (Is this a general problem with the Calculation flow?)
  • If you select a remote seed and then refresh, the hash doesn't successfully select it
  • For imported remote seeds, render them as packet options and also render their seeds when selected
  • Rename seed / rename packet should update instances of that seed reference in the currently loaded packets
  • Warn earlier for obviously invalid API keys (e.g. unset ones) (and also detect those failures from the API and throw)
  • Fix the bug where collapsing a seed when viewing a remote packet fails (it assumes that only happens on local packets)
  • run-dialog should show in summary what the last event seed reference was
  • Add a swap_name button next to each type=object key
  • Add an undo/redo button (is it possible to use redux?)
  • Add a nest button to add a type: noop above a given seed
  • Add a confirm dialog_type and replace all use of confirm() with it (add it on profile and prompter)
  • When a seed is running, make all ui disabled (not just allowEditing)
  • Adding a protected key like mock in environment editor breaks it, it can't get protected key mock
  • Update README about how to use the UI
  • Actually store currentPacketRemote in state and use in selector
  • Add a remotePackets in the data state and change all action creators to take it
  • fetchSeedPacket should check for isLocal() and if so combine it with /seeds/.
  • fix runSeed for remote seeds
  • Seed reference should allow adding a packet
  • Seed-reference-editor should auto-complete available seeds and references
  • When seed-reference-editor has a new remote packet added, fetch the remote packet (so we have the infformation to do a reference completion)
  • Show run-state with more complex logging
  • Split out AppProfile, which has a prompt and providePromptResult()
  • Have prompt happen in a dialog, with choices
  • auto-select the type when it renders
  • Boolean environment-editor variables should allow true/false only
  • Fix bug where collapsing an element in an array doesn't work
  • Consider allowing dialogs to stack and have multiple going at once (dialogState would be an array, app-dialog would be a connected component that knows how to render and action dialogs, and then main-view would print out enough app-dialogs)
  • In the dialog for messages being rendered, convert line breaks to <br>
  • Allow adding new items to array or object type (e.g. type:input/choices)
  • When prompt is cancelled, call providePromptRejection
  • Use the choices dialog for environment variables setting
  • environment-editor should disable keys already added
  • Consider using emojis instead of icons for all buttons
  • When changing environment validate zod types and fail the action creator if it doesn’t work (does environment validate the data for the environment when it's loaded?)
  • Fix the bug where on the first run it complains about a missing packet during load
  • Fix the bug where changing type of a seed in the editor breaks something
  • environment-editor should have description of each key
  • environment-editor should group keys by type (e.g. secret, protected, default) and have e.g. key/value grayed out
  • environment-editor should handle e.g. boolean keys
  • Allow editing environment for a packet (use environment-editor, in a dialog).
  • Have the packet and see sections the toolbar of packet-editor both be flex=1 so they move around less often (currently where the buttons show up is based on length of the labels)
  • When selecting a packet from seed-list, auto-expand it if closed.
  • util.ts already has types so merge in typedUtil
  • displayName in wrapped packet should actually be used in seed-list if set.
  • remotes should get a domain TLD : filename displayName.
  • Allow editing displayName in UI
  • Use PropertyShape.choice for seed arguments to render a select
  • Fix bug where running a seed that uses token-count doesn't work in browser environment
  • Add a collapsed field on packetWrapper for zippy in seed-list
  • Add collapsed for sub-seeds
  • seed-referenced-editor should have more explicit controls
  • Instead of having the whole packetName in URL, what about just having a 6-digit hash for cleaner looking URLs?
  • More aggressive typing of Actions (espeically for Data) so we find data errors faster.
  • If a text control is not focused, arrow up/down should change selection of seeds. command-enter should run it. command-arrow should move up or down packets at a time.
  • Move seed controls back to top bar above seed-editor in packet-editor (known location that doesn't shift much)
  • Actually store remotePackets. (Note that when they are in a wrapper with e.g. lastUpdated those will need to be converted to/from timestamps)
  • Make generate:config be run as part of npm run serve
  • Add a refresh remote button in UI
  • DELETE_PACKET and LOAD_PACKETS need to take a packetType
  • PacketWrapper should have displayName (when you hover it shoudl show the full name in title). This will be useful for remotes, where we should show just the TLD : packetName)
  • First run should have all of the example files (a command to generate listings so it knows which ones to import)
  • Add an affordance in the UI to import a seed packet (pop out importPacket, which prompts for a location, and importPacketAtLocation, the current behavior)
  • Seed-list shoudl actually render remotes
  • make it so you can delete an imported remote from the UI
  • seed-list should take remotePackets and print them out
  • PacketsBundle now has a PacketWrapper inside, which has the packet but also metadata like lastUpdated, fetchingState : 'complete', 'fetching', 'failed', displayName, and that's used to render the list differently while it's loading
  • Add an importPacket(location) which fetches it and puts it in remotes
  • Verify that WDS serves seeds from seeds (that should be assumed to be the starting location of seed files for local files)
  • Verify it doesn't fetch seed files outside of seeds
  • Have an import that loads a local (or remote) file. It stores it in remotes: {[location : PacketLocation]: {lastUpdated: <time>, packet: Packet}}.
  • Seeds that use an api key should warn if it's empty
  • Render remotes in packet-list as read-only
  • for packetName and seedID when creating one, verify it passes the regex
  • Add a fork button next to packets (in the future it will include parent), even if they are readonly. Every fork is in the locals packet. Rename it for the last path component.
  • Add required types to the seed when switching types in the UI (e.g. you switch to type if, add else, test, then)
  • In bar/baz, switch the value to type seed then switch it to if. For some reason it gives a broken/weird error message that errorsByPath doesn't currently know how to handle.
  • When changing seed type in changeSeedType, any values for no-longer-required properties that are set to the default value should be removed (although it would be the default value from the OLD type, not the new one)
  • Core profile.delete() should return true if the key was not set in the map
  • Add AppProfile.prompt()
  • AppProfile should persist data to localStorage by hooking _memoryUpdated and _storeUpdated. (store each one as a separate localStorage key (e.g. memory_NAME) so that writes only affect one of them at a time. And then retrieve them from storage at boot.
  • Add a .editable for seed-editor that cascades downwards
  • Allow loading a seed packet from local URL or remote URL (non editable)
  • Allow editing inline of values in environment-editor
  • Add a drop-down in environment-editor that shows known key types (filtering out ones that are already set) and allowing a Custom... option that pops a prompt.
  • Allow a view button to view a secret key in environment-editor
  • Add an affordance to add a parent noop seed between the seed's parent and it
  • Add an affordance to swap a given sub-seed from one property to another
  • In data, have a remotes property that lists packetName and then to a dict of {lastFetched}. And then any packet that has a value in remotes, set to non-editable and show in the seed-list as remote
  • Add an environment data
  • Allow localFetches that automatically load from seeds/ (put that in the copy in build)
  • When runSeed has an error or result, show it in a normal UI in line.
  • Consider moving run/json/delete etc controls to a control bar above seed-editor (when they're in seed-list, they jump around a lot)
  • seed-list should show a warning for any seeds that don't validate currently
  • Only load the current packet into the library by default
  • Add a profile that knows how to fetch the other packets locally so they can be pulled in only if the currentPacket loads them.
  • Allow adding / changing a key in environment with alerts
  • Move environment editing / viewing to a dedicated control
  • Add a garden sub-state for results of the garden run
  • Add a play button next to specific seeds in the editor
  • Add a parent (or 'fork`?) in SeedPacket top level properties to show where it was forked from
  • Allow 'forking' a seed packet that is not editable to be ont hat is editable.
  • json-editor, which is used for any unknown property
  • Allow readout editor to also edit the textarea
  • Select text when readout dialog shows up
  • Rename readout to edit-json or something
  • Allow an edit-packet-json and a edit-seed-json
  • Fill in missing arguments descriptions in seed data types
  • Add a type to the PropertyShape and use it to set the default value for the control
  • Render little help badge next to each property with a description
  • Fix the bug where SeedShape.description doesn't get the description that's set via z.literal('seed_type').description
  • Render out optional property names after required ones (and add (optional)
  • Automatically add missing required property names when seed type changes
  • Render warning indicators next to extra properties in a seed (e.g. properties that exist from another seed type)
  • value-editor renders different controls if it's boolean/number/string/object/array
  • Add a cloneAndDelete helper method
  • Render descriptions for each seed type in the type dropdown
  • value-editor renders different controls for array
  • value-editor takes a config object that describes how to render different subcontrols.
  • A way to create a value-editor config for a zod type
  • A seed-reference-editor and seed-editor should show an error warning (with a tooltip) if they fail to parse (e.g. missing required parameters)
  • value-editor allows editing values
  • Add a way to change the leaf type of an object (nested seed, seed reference, object, array, string, boolean, number)
  • Add a way to add / delete a seed
  • Create a webapp that can load up any seed from any URL (with a url parameter) and allow inspecting it
  • Add a description help text next to seedData names, and alos in the 'addKey' drop down.
  • Add a way to add properties on object type
  • Make a swap property button to swap a given named property's value to another one
  • value-editor should take a list of allowed property types, and it should render a (!) next to those. Then seed-editor should pass allowedTypes to it, so it can warn before you add an illegal type
  • When adding an item have it be of a proper literal type
  • Add a remove button to seed and object key
  • Add a 'add property' button to end of object type in value-editor (prompt for name)
  • Render little warnings next to invalid properties (not just next to type). Only render warning next to type for missing properties, for everything else render it next to the part with an error.
  • Add a 'add item' button to end of array type in value-editor
  • Have the keys to add be listed separately from base keys and keys specific to this seed type (with a divider)
  • Bug: Take a noop's value of null and switch to seed type. Now switch the sub-seed's type to something other than noop. It now switches to an object with a type field. The reason is because it doesn't validate (it's missing required properties) so it says "whatever, I guess it's not a seed type".
  • Have seed, packet in the hash of the page
  • When there's a sub-seed that is invalid (e.g. missing properties), it renders an alert icon for it... and all parent seeds, too. Ideally it would only show the inner most one.
  • When switching between seed types, render out required properties with default values and remove invalid properties
  • Add a cloneObjectWithChange(path : ObjectPath, value : JSONValue) that returns a clone of the object with the path changed as configured.
  • A very simple direct editor for the currently selected seed
  • Make it so the textarea updates of the seed are pushed back into the packets.
  • Render a list of seeds along the side to allow one-click switching
  • When changing a property in the seed, check to see if the new value is legal or not
  • seed-editor should render out other properties too
  • Allow deleting a seed
  • Allow running a seed packet live in browser
  • Allow adding a seed
  • Allow rendering a sub-seed
  • Start popping out a viewer for a given seed that shows sub-fields etc. Unknown fields should be a JSON editor, and then slowly make them more typed.
  • Make the webapp a sub package?
  • Make the seedData types be strict for each type, so that extra values on the object will also warn
  • Allow setting API keys
  • Allow having the environment in environment.SECRET.json be used and overlaid with any modifications in localStorage.
  • Use the same typing I now use for card-web for thunk handlers
  • Remove as unknown as ThunkMiddleware... in applymiddleware in store.ts
  • Get build and deploy working
  • Persist currentPacket in hash

jkomoros added a commit that referenced this issue Aug 6, 2023
It's a hastily cut down version of the current webapp of adjacency-map.

I've confirmed it loads the hello-world but not much beyond that.

Part of #6.
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Aug 6, 2023
jkomoros added a commit that referenced this issue Sep 24, 2023
This is better than relying on disallowTypeChange.

Part of #6
jkomoros added a commit that referenced this issue Sep 24, 2023
The better test is disallowDelete, becuase shuffling it effectively deletes it.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
jkomoros added a commit that referenced this issue Sep 24, 2023
…ecisely one allowed type or not.

This is the last use of allowTypeChange.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
This also removes the last reliance of disallowDelete, which can now rely on this.

This actulaly nicely cleans up some buttons.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
As of the last commit, values that were nested more than one notch below seed-editor would have no delete
button.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
Both of these are now better handled by propertyShape.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
jkomoros added a commit that referenced this issue Sep 24, 2023
This is better for archiving.

Uses fflate, which is typed, fast, and small.

Part of #6.
jkomoros added a commit that referenced this issue Sep 24, 2023
jkomoros added a commit that referenced this issue Sep 24, 2023
This ensures that the donwloaded zips don't get a lot of (1) and makes it a more convenient format for archives and backups.

Part of #6.
jkomoros added a commit that referenced this issue Sep 28, 2023
…l non-empty-array.

It's kind of a pain to have to assert an array is non-empty when passing in values (although it is nice to
rely on later, but not THAT nice).

Part of #6.
jkomoros added a commit that referenced this issue Sep 28, 2023
…ices as an optional property.

This allows multiLine to be passed, although it's not yet actually used.

Part of #6.
jkomoros added a commit that referenced this issue Oct 8, 2023
…ncept of an 'unknown'/any TypeShape.

Currently TypeShape is basically just an indirected wrapper for PropertyType, but with the addition of an
'unknown' value, which means 'fine with any PropertyType'.

This changes a bit of the logic for when and how to render drop downs, which I believe is working.

This work will allow in the near future specifying sub-object and sub-array types instead of just "it's an
array 🤷"

Part of #6.
jkomoros added a commit that referenced this issue Oct 8, 2023
jkomoros added a commit that referenced this issue Oct 8, 2023
Currently those innerShapes are all type:unknown, so they allow anything.

Part of #6.
jkomoros added a commit that referenced this issue Oct 9, 2023
jkomoros added a commit that referenced this issue Oct 9, 2023
…in extra information.

The output of propertyShapes is verified to be semantically identical before and after this refactor.

Part of #6.
jkomoros added a commit that referenced this issue Oct 9, 2023
…d seed/reference/input types.

This does change the output of the SHAPE_BY_SEED, mostly for call.function, array.items, and object.items,
but arguably in ways that are more precisely accurate than before.

This also simplifies the logic and removes some specialized behavior.

Part of #6.
jkomoros added a commit that referenced this issue Oct 9, 2023
jkomoros added a commit that referenced this issue Oct 9, 2023
Currently this is somewhat unncessary, but when we start processing array or object inner types it's
necessary to avoid an infinite loop, since inputValue and value recurse.

Part of #6.
jkomoros added a commit that referenced this issue Oct 9, 2023
This means that for example in input.choices, it's properly constrained to a string.

Part of #6.
jkomoros added a commit that referenced this issue Oct 9, 2023
In the last commit (d97b350) we changed the schema to allow {value: string, display?: string, description?:string} options, but the actual seed execution wasn't yet
updated so it would barf at runtime if an object was provided.

Now we allow those options.

Part of #6.
jkomoros added a commit that referenced this issue Oct 21, 2023
It was broken in 0e1d9fa because choicesAsStrings is actually used in more places than I realized, and it required being able to return undefined.

After that change broke it, you couldn't add an openai_api_key in the environment editor because it would render a blank drop down.

Part of #6.
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

No branches or pull requests

1 participant