-
Notifications
You must be signed in to change notification settings - Fork 24
Add user templates for experiments. #871
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7d21ab4
Create CRUD for experiments, and basic vibe coded support - to clean …
aldenhallak ad3222c
Add save template dialog and section for backend templates.
aldenhallak af74909
Make template saving more visible
aldenhallak 50f7b86
Add update template functionality.
aldenhallak 471b964
Ensure that templates have unique names.
aldenhallak 295c558
prettier + lint
aldenhallak c28a971
Add documentation for experiments.
aldenhallak 35bcfbd
Merge branch 'main' into experiments
aldenhallak 3d769aa
Merge remote-tracking branch 'upstream/main' into experiments
aldenhallak 005be48
Merge origin/experiments and resolve conflicts, keeping research temp…
aldenhallak 4fcdbd2
Fix broken stage_builder_dialog.ts by restoring from correct state
aldenhallak 7a5ddc7
Remove the specification of collection from standard experiment endpo…
aldenhallak 5042f58
Update button to be in header and to have save new template as dropdown.
aldenhallak a94b480
remove passed in collection name and ensure typing is strong.
aldenhallak c1f0e45
Merge branch 'main' into experiments
aldenhallak d06ce1f
Add template update/reset logic, loading state to save button, and me…
aldenhallak 8d38d62
Merge branch 'main' into experiments
aldenhallak e6cb7b2
Use variables instead of hardcoded values, so they will match system …
aldenhallak 7c23567
Add tooltip.
aldenhallak 03ecb03
Merge branch 'main' into experiments
cjqian 6b5811d
Add template sharing functionality with public, private, and shared v…
aldenhallak b448d07
Merge branch 'experiments' of https://github.com/aldenhallak/delibera…
aldenhallak 7aca98d
Share Template -> Modify Sharing Settings. Only the creator can modif…
aldenhallak 25587f9
extract experiment builder dialog styles to dedicated SCSS files and …
aldenhallak 3a355f3
Merge branch 'main' into experiments
vivtsai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| title: Experiment templates | ||
| layout: default | ||
| --- | ||
|
|
||
| # Experiment templates | ||
|
|
||
| Experiment templates allow you to quickly create new experiments based on pre-defined configurations. You can use built-in templates or create your own. | ||
|
|
||
| ## Loading a template | ||
|
|
||
| When building an experiment, you can load a template to populate the stages and settings. | ||
|
|
||
| 1. In the experiment builder, click the **Load template** button in the left sidebar. | ||
| 2. Browse the gallery of available templates. | ||
| * **Built-in Templates**: Pre-defined templates included with Deliberate Lab. | ||
| * **Saved Templates**: Templates you or your team have created and saved. | ||
| 3. Click on a template to apply it to your current experiment. **Warning: This will overwrite your current stages and settings.** | ||
|
|
||
| ## Saving a new template | ||
|
|
||
| You can save your current experiment configuration as a new template for future use. | ||
|
|
||
| 1. In the experiment builder, click the **Save as template** button in the top right corner. | ||
| 2. Enter a name and description for your template. | ||
| 3. Click **Save**. | ||
|
|
||
| ## Updating a template | ||
|
|
||
| If you have loaded a template and made changes, you can update the original template with your new configuration. | ||
|
|
||
| 1. Load a template. | ||
| 2. Make your desired changes to the stages or settings. | ||
| 3. Click the **Update template** button in the top right corner. | ||
| 4. Confirm the update in the dialog. | ||
|
|
||
| ## Deleting a template | ||
|
|
||
| You can delete saved templates that are no longer needed. | ||
|
|
||
| 1. Click the **Load template** button in the left sidebar. | ||
| 2. Find the template you want to delete in the **Saved Templates** section. | ||
| 3. Click the delete icon (trash can) on the template card. | ||
| 4. Confirm the deletion. | ||
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
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
86 changes: 86 additions & 0 deletions
86
frontend/src/components/experiment_builder/save_template_dialog.scss
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| @use '../../sass/typescale'; | ||
|
|
||
| :host { | ||
| display: block; | ||
| } | ||
|
|
||
| .dialog-overlay { | ||
| position: fixed; | ||
| top: 0; | ||
| left: 0; | ||
| width: 100%; | ||
| height: 100%; | ||
| background: rgba(0, 0, 0, 0.32); | ||
| display: flex; | ||
| justify-content: center; | ||
| align-items: center; | ||
| z-index: 10; | ||
| } | ||
|
|
||
| .dialog { | ||
| background: var(--md-sys-color-surface); | ||
| border-radius: 8px; | ||
| width: 500px; | ||
| max-width: 90%; | ||
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); | ||
| display: flex; | ||
| flex-direction: column; | ||
| color: var(--md-sys-color-on-surface); | ||
| } | ||
|
|
||
| .header { | ||
| padding: 16px; | ||
| border-bottom: 1px solid var(--md-sys-color-outline-variant); | ||
| display: flex; | ||
| justify-content: space-between; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .title { | ||
| @include typescale.title-large; | ||
| } | ||
|
|
||
| .body { | ||
| padding: 16px; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 16px; | ||
| } | ||
|
|
||
| .footer { | ||
| padding: 16px; | ||
| border-top: 1px solid var(--md-sys-color-outline-variant); | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| gap: 8px; | ||
| } | ||
|
|
||
| pr-textarea { | ||
| width: 100%; | ||
| } | ||
|
|
||
| .error-message { | ||
| @include typescale.label-small; | ||
| color: var(--md-sys-color-error); | ||
| margin-top: 4px; | ||
| } | ||
|
|
||
| .form-group { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 4px; | ||
|
|
||
| label { | ||
| @include typescale.label-medium; | ||
| } | ||
| } | ||
|
|
||
| select { | ||
| @include typescale.label-medium; | ||
| width: 100%; | ||
| padding: 8px; | ||
| border: 1px solid var(--md-sys-color-outline); | ||
| border-radius: 4px; | ||
| background: var(--md-sys-color-surface); | ||
| color: var(--md-sys-color-on-surface); | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.