-
Notifications
You must be signed in to change notification settings - Fork 2
Dylan/feat/reducers editor tool #19
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
Open
dylanh724
wants to merge
245
commits into
clockworklabs:master
Choose a base branch
from
dylanh724:dylan/feat/reducers-editor-tool
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dylan/feat/reducers editor tool #19
dylanh724
wants to merge
245
commits into
clockworklabs:master
from
dylanh724:dylan/feat/reducers-editor-tool
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Runs cross-platform CLI commands in the background and parses them for friendly results - Features: * Detects and cross-platform installs SpacetimeDB CLI if !detected * View list of servers|identities * Add server|identity * Change server|identity * Ensure identities are bound to servers (refresh on server change) * FilePicker for publish/to/module path * Publish result with DateTime, Host, IsOptimizedBuild * Detection of `wasm-opt` for optimization; show install button if !found (in post-publish result cache) * Regenerate local|testnet servers if 0 servers found * Cleanly-exited Process via cancel token support * Progress bars and status labels * CLI Error handling * Some persistence cache, but we mostly get live updates from the CLI * UX: Prettified, responsive design, Local validation, groups, focus/selectAll when applicable, status labels, integrity checks, top banner click links to docs, body wraped in scrollView, fonts and colors match docs
- For future Editor tools that may coincide with Publisher, I added a `Common` dir - Moved core CLI commands to a common `SpacetimeDbCli.cs` - Created a "common" USS stylesheet so future editor tools can utilize this with a core, templated style. - Set the non-common USS stylesheet as active at the top (custom one *must* be at top, as that's what's default set active) - Better USS/UXML naming - Added sanity checks for USS/UXML loading
- For future Editor tools that may coincide with Publisher, I added a `Common` dir - Moved core CLI commands to a common `SpacetimeDbCli.cs` - Created a "common" USS stylesheet so future editor tools can utilize this with a core, templated style. - Set the non-common USS stylesheet as active at the top (custom one *must* be at top, as that's what's default set active) - Better USS/UXML naming - Added sanity checks for USS/UXML loading - fix: HasIdentitiesButNoDefault + HasServersButNoDefault were resulting in opposite expectations
- Currently has the Publish window template UI; will strip this next commit (keeping what we need)
…ditor-tool # Conflicts: # Scripts/Editor/Common/SpacetimeDbCli/Models/GetIdentitiesResult.cs # Scripts/Editor/Common/SpacetimeDbCli/Models/PublishResult.cs # Scripts/Editor/Common/SpacetimeDbCli/Models/PublishResult.cs.meta # Scripts/Editor/Common/SpacetimeDbCli/Models/PublishServerModuleResult.cs # Scripts/Editor/Common/SpacetimeDbCli/Models/PublishServerModuleResult.cs.meta # Scripts/Editor/Common/SpacetimeDbCli/SpacetimeDbCli.cs # Scripts/Editor/Common/SpacetimeDbCli/SpacetimeDbPublisherCli.cs # Scripts/Editor/Common/SpacetimeMeta.cs # Scripts/Editor/SpacetimePublisher/PublisherWindowComponents.uxml # Scripts/Editor/SpacetimePublisher/Scripts/Models/PublishServerModuleResult.cs # Scripts/Editor/SpacetimePublisher/Scripts/Models/PublishServerModuleResult.cs.meta # Scripts/Editor/SpacetimePublisher/Scripts/PublisherWindowActions.cs
…ditor-tool # Conflicts: # Scripts/Editor/Common/SpacetimeDbCli/Models/GetIdentitiesResult.cs # Scripts/Editor/Common/SpacetimeDbCli/SpacetimeDbPublisherCli.cs # Scripts/Editor/SpacetimePublisher/Scripts/PublisherWindowActions.cs
- Pulls data from Publisher, if previously published, to get the default module name.
…ditor-tool # Conflicts: # Scripts/Editor/SpacetimePublisher/Scripts/PublisherWindowActions.cs
- Also fix an async naming/discard convention
…ditor-tool # Conflicts: # Scripts/Editor/SpacetimePublisher/Scripts/PublisherWindowActions.cs
- Plus, remove testing placeholders - Rn "Call" btn val to "Call Reducer" - Bring bold back to buttons when done (the orig text restored)
- Prevents build errs. This is *technically* a workaround for a Unity bug, since /Editor is supposed to be ignored by build processes anyway.
…ditor-tool # Conflicts: # Editor/Common/SpacetimeDbCli/SpacetimeDbCliActions.cs
- Caused by a Unity bug (imploded Label)
- Pulls from Publisher - Defaults to default identity, if none previously selected - Will persist previously selected (and will soft check if still valid)
- Unused, yet, with TODO notes! @john wanted to have this, so I got ya started
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About
GUI Reducer listing/calling with prefilled with the CLI-default server/identity (and module name, if cached from previously using the other "Publisher" tool).
Why?
With the Publisher tool, we took away numerous CLI burdens and tossed it into a GUI with persistence to remember your prefs.
The effort continues! Less CLI burdens, more GUI, easier onboarding/reducer testing.
Prerequisites
Branched from clockworklabs/com.clockworklabs.spacetimedbsdk#17 - resolve this PR 1st
Feats
Get default selected server/identity from CLI and load it into UI @ init
Get last-published module Name and load it into a TreeView UI @ init, if any
Parses
spacetime describe
into a modelParses describe into an EntityInfo model with extra info, such as [formatted] syntax hints and more
Refresh button, in case we changed something after init
"Call Reducer" button for reducers with results shown below
UX: Local validation, btn enable/disables on ready/done, progressive UI reveal, btn status labels on click, window wrapped in ScrollView, result labels wrapped in ScrollView (in case of lengthy errs), can dock to editor UI as a tab
Minor Publish optimizations (since closely related and templated from)
--as-identity
supportErr handling:
#VisualElement
name integrity⚙️ Editor tool only: This won't bloat builds.
⚙️ Tested in Unity 2022.3.20 LTS
Ideas for future PRs:
spacetime describe
into a common model, there are likely other fun tools to be made from this.spacetime describe
results, for example).Testing
TODO
chat_message
- I get an err response"Player not found"