-
Notifications
You must be signed in to change notification settings - Fork 474
[Frontend] App playground local mode #4 - stateful urls #3616
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
Draft
ardaerzin
wants to merge
36
commits into
frontend-feature/stateless-playground-integration
Choose a base branch
from
frontend-feature/stateless-playground-url-state
base: frontend-feature/stateless-playground-integration
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.
Draft
[Frontend] App playground local mode #4 - stateful urls #3616
ardaerzin
wants to merge
36
commits into
frontend-feature/stateless-playground-integration
from
frontend-feature/stateless-playground-url-state
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
…mpression - Add snapshot subpath export to package.json - Add lz-string@1.5.0 dependency for compression - Add @types/lz-string@1.5.0 dev dependency
… management - Add snapshot.ts with buildOssAppRevisionDraftPatch and applyOssAppRevisionDraftPatch functions - Add parameterConversion.ts utilities for enhanced data conversion and comparison - Export snapshot functions and types from ossAppRevision package - Update isDirty check to compare parameters instead of full objects - Add stripVolatileKeys, enhancedPromptsToParameters, enhancedCustomPropertiesToParameters helpers - Add
… runnable entities - Add snapshotAdapter.ts registry for unified snapshot operations across runnable types - Implement appRevision snapshot adapter with buildDraftPatch and applyDraftPatch functions - Implement ossAppRevision snapshot adapter using existing snapshot utilities - Add auto-registration of adapters on module import - Add Zod validation schemas for patch data structures - Export snapshot adapter types and registry from
…port - Add uuid@^11.1.0 dependency for draft key generation - Add snapshot submodule with schema, codec, and validation utilities - Add PlaygroundSnapshotV2 schema supporting commit and draft selection items - Add encodeSnapshot/decodeSnapshot functions using lz-string compression - Add snapshot controller and hydration utilities to state management - Export snapshot types and functions from main package entry point - Add MAX_ENCODED
- Add uuid@^11.1.0 to playground package dependencies
…ydration documentation - Export clearPendingHydrations function from state module - Update snapshot module documentation to reference PlaygroundSnapshotV2 instead of V1 - Simplify hydrateSnapshotAtom implementation by removing unnecessary snapshotV2 variable - Update hydration documentation to remove v1 migration step from process description
…ot and update version to 1 - Remove PlaygroundSnapshotV2 type alias in favor of single PlaygroundSnapshot type - Update SNAPSHOT_VERSION from 2 to 1 - Update all type references from PlaygroundSnapshotV2 to PlaygroundSnapshot - Update version validation error message to use SNAPSHOT_VERSION constant - Update documentation examples to reference PlaygroundSnapshot and use SNAPSHOT_VERSION constant
…aring with runnable type resolution - Add urlSnapshotController with buildEncodedSnapshot, buildUrlComponents, and hydrateFromUrl actions - Add RunnableTypeResolver interface for entity-agnostic type resolution - Add setRunnableTypeResolver, getRunnableTypeResolver, and resetRunnableTypeResolver utilities - Add hydrationComplete and pendingHydrationCount selectors for tracking hydration status - Add applyPendingHydrations action
…pport - Add usePlaygroundUrlSync hook to sync selection and drafts to URL in real-time - Add urlSnapshotController integration with OSS runnable type resolver - Add snapshot hash parameter (#pgSnapshot) for encoding draft patches in URL - Add clearSnapshotFromUrl and updatePlaygroundUrlWithDrafts utilities - Add selectedDraftHashAtom and selectedServerDataHashAtom for change detection - Add isSelectionStorageHydrated check to prevent overwriting persisted selections
…t clearing - Remove clearSnapshotFromUrl import and usage from usePlaygroundUrlSync - Remove prevHydrationCompleteRef and hydration completion URL clearing effect - Remove snapshot clearing after applying pending hydrations - Rely on draftHash effect to rebuild URL when draft state changes after hydration - Add comment explaining URL rebuild behavior during hydration
…state detection - Add debug logging to ossAppRevisionIsDirtyWithBridgeAtomFamily when dirty state is detected - Strip null values from message objects during parameter comparison to match server data format - Update stripVolatileKeys to skip null values in nested objects (name, toolCalls, toolCallId) - Update stripVolatileKeys documentation to clarify null handling behavior - Extract strippedDraft and strippedServer variables for debug
… frontend-feature/stateless-playground-url-state
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… frontend-feature/stateless-playground-url-state
… frontend-feature/stateless-playground-url-state
… frontend-feature/stateless-playground-url-state
… frontend-feature/stateless-playground-url-state
- Add isPlaceholderId function to detect placeholder IDs used during pending hydrations - Update isLocalDraftId to recognize numeric-only IDs (timestamps) as local drafts - Export isPlaceholderId from shared utils
…ter interface - Add optional createLocalDraftWithPatch method for hydration support - Used to recreate local drafts from URL snapshots with patches
… snapshotAdapter - Add createLocalDraftWithPatch for hydrating local drafts from URL snapshots - Add generatePlaceholderId and isPlaceholderId helpers - Export isPlaceholderId from ossAppRevision module
…r createLocalDraftFromRevision - Add resolveRootSourceId to always point to server revision, not another local draft - Make createLocalDraftFromRevision return null instead of throwing when source unavailable - Add getLocalDraftBySourceId helper for finding existing drafts - Export resolveRootSourceId for use in snapshot adapters
- Add isPlaceholderId check to directQueryAtomFamily and enrichedQueryAtomFamily - Placeholder IDs are temporary IDs used during pending hydrations - Remove debug logging from isDirty check
…pshotController - Add generatePlaceholderId for temporary IDs during pending hydrations - Support creating local drafts for duplicate source revisions in compare mode - Add selectionUpdateCallback for replacing placeholder IDs with actual local draft IDs - Track pending hydrations with createLocalDraft flag and selectionIndex - Export setSelectionUpdateCallback and isPlaceholderId
…arams - Local draft IDs are ephemeral and won't work when opened in a new tab - Resolve to source revision IDs for the query param - Hash param contains patch data to reconstruct draft state
- Export new functions from agenta-playground package for OSS consumption
- Register callback to replace placeholder/source IDs with local draft IDs - Use latestAppRevisionIdAtom for default selection (matches 'Last modified' tag) - Skip URL revision processing when pending hydrations exist - Improve ensurePlaygroundDefaults logic
- Remove console.log statements from discardRevisionDraft - Remove unused prompt-related code from prompts.ts
- URL is now the source of truth for sharing playground state - Add placeholder ID support to displayedVariantsAtom and earlyDisplayedVariantsAtom - Use updatedAt for proper timestamp sorting in playgroundRevisionListAtom - isSelectionStorageHydrated now always returns true (no async hydration needed)
- Extract source revision IDs from pending hydrations for proper triggering - Use pendingSourceDataHash to track when source data becomes available - Apply pending hydrations based on source IDs, not selected variants
- Remove unused imports from MainLayout, SelectVariant, VariantNavigationCard - Remove unused code from PlaygroundVariantConfigEditors - Simplify PlaygroundVariantCustomProperties
…ps://github.com/Agenta-AI/agenta into frontend-feature/stateless-playground-url-state
… frontend-feature/stateless-playground-url-state
…romptsToParameters - Add toSnakeCaseKey and toSnakeCaseDeep helper functions for key normalization - Extract llmConfig from enhanced prompts with snake_case conversion when needed - Extract templateFormat from enhanced prompts with proper key detection - Preserve existing key naming conventions (snake_case vs camelCase) in result - Enable dirty checks for model parameters and prompt syntax changes
…onents - Remove unused `useEffect` import from PlaygroundVariantConfigEditors - Remove unused `debug` variable from useVariantPrompts destructuring - Remove unused `schemaQuery` variable assignment in PlaygroundVariantCustomProperties
… oss - Add ellipsis to --filter flags to install workspace dependencies - Update @agenta/ee filter to @agenta/ee... - Update @agenta/oss filter to @agenta/oss...
… frontend-feature/stateless-playground-url-state
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.
the introduction of local drafts demanded a stateful url for playground with more information than just the displayed revision ids.
with this pr, we'll now have urls with: