Skip to content

Commit 749a10a

Browse files
committed
Adds new documentation for the Scripting Editor
Introduces FAQ, Quick Reference, and a comprehensive User Guide. Improves discoverability of key features, streamlines user onboarding, and clarifies advanced functionality for more efficient scripting.
1 parent ae334d6 commit 749a10a

File tree

3 files changed

+683
-0
lines changed

3 files changed

+683
-0
lines changed

docs/editor-faq.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# TrackMan App Scripting Editor - Frequently Asked Questions
2+
3+
## Getting Started
4+
5+
### Q: How do I create my first script?
6+
**A:** Click the "New" button in the toolbar, or press `Ctrl + N`. This creates a blank script with a start and end activity. You can then add activities by dragging them from the Activities Panel.
7+
8+
### Q: What file formats are supported?
9+
**A:** The editor primarily works with JSON files (.json) for scripts. You can also import plain text files and export scripts in various formats including compressed packages.
10+
11+
### Q: How do I save my work?
12+
**A:** Use `Ctrl + S` or click the "Save" button. Your script will be saved as a JSON file. Always save before testing or closing the editor.
13+
14+
## Script Building
15+
16+
### Q: How do I connect activities together?
17+
**A:** Each activity has a "next" property that specifies which activity runs next. Set this to the ID of the target activity. For conditional activities, use "trueNext" and "falseNext" properties.
18+
19+
### Q: Can I reuse activities in multiple places?
20+
**A:** Each activity must have a unique ID within a script. If you need similar functionality in multiple places, create separate activities with different IDs but the same configuration.
21+
22+
### Q: How do I handle user input?
23+
**A:** Use Input activities. Set the "prompt" property to ask the user a question, and specify a "variable" name to store their response. The variable can then be used in other activities.
24+
25+
### Q: What's the difference between variables and properties?
26+
**A:** Properties are configuration settings for activities (like prompt text or calculation formulas). Variables are data storage that can change during script execution and be passed between activities.
27+
28+
## Troubleshooting
29+
30+
### Q: My script won't run - what should I check?
31+
**A:** Common issues:
32+
1. Ensure all activities have valid "next" references
33+
2. Check that variable names are spelled correctly
34+
3. Verify JSON syntax is valid
35+
4. Make sure there's a path from start to end
36+
5. Look for circular references between activities
37+
38+
### Q: How do I debug a script that's not working correctly?
39+
**A:** Use the Debug Panel to:
40+
1. View execution logs
41+
2. Check variable values at each step
42+
3. See which activities are being executed
43+
4. Identify where execution stops or fails
44+
45+
### Q: Why do I get "Variable not defined" errors?
46+
**A:** This happens when you reference a variable before it's been created. Make sure:
47+
1. Input activities that create variables run before activities that use them
48+
2. Variable names are spelled consistently
49+
3. The script flow reaches the variable creation activity
50+
51+
### Q: How do I fix circular reference errors?
52+
**A:** This occurs when activities reference each other in a loop. Check your "next" properties to ensure there's no infinite loop. Draw out your script flow to visualize the connections.
53+
54+
## Advanced Features
55+
56+
### Q: Can I create custom activities?
57+
**A:** Yes! Use the Custom activity type and define your own properties and behavior. You can create reusable components for common operations.
58+
59+
### Q: How do I handle complex data structures?
60+
**A:** Use object and array data types. You can nest objects and arrays to create complex data structures. Access nested properties using dot notation (e.g., "user.name").
61+
62+
### Q: Can I include external data or APIs?
63+
**A:** The editor supports various input sources. You can configure activities to fetch data from external sources, though specific capabilities depend on your deployment environment.
64+
65+
### Q: How do I optimize script performance?
66+
**A:** Best practices:
67+
1. Minimize the number of activities in loops
68+
2. Use efficient data structures
69+
3. Cache frequently accessed values
70+
4. Avoid deep nesting of conditions
71+
5. Test with realistic data volumes
72+
73+
## File Management
74+
75+
### Q: How do I share scripts with other users?
76+
**A:** Scripts are saved as JSON files that can be easily shared. You can:
77+
1. Export scripts using the Download button
78+
2. Share the JSON file directly
79+
3. Use version control systems for team collaboration
80+
4. Create script packages with multiple related scripts
81+
82+
### Q: Can I import scripts from other systems?
83+
**A:** If the scripts are in JSON format with compatible structure, yes. You may need to adjust activity types and properties to match the editor's schema.
84+
85+
### Q: How do I backup my scripts?
86+
**A:** Regularly download your scripts as JSON files and store them securely. Consider using cloud storage or version control systems for automatic backups.
87+
88+
### Q: What happens if I lose my work?
89+
**A:** If you haven't saved your script, changes may be lost when closing the editor. Always save frequently. Some browsers may retain unsaved changes temporarily, but this isn't guaranteed.
90+
91+
## UI and Customization
92+
93+
### Q: Can I customize the editor interface?
94+
**A:** Yes! Use the Settings panel to:
95+
1. Adjust theme and colors
96+
2. Configure panel layouts
97+
3. Set default properties for activities
98+
4. Customize keyboard shortcuts
99+
5. Configure auto-save settings
100+
101+
### Q: How do I resize panels?
102+
**A:** Click and drag the borders between panels to resize them. Double-click borders to auto-fit content.
103+
104+
### Q: Can I hide panels I don't use?
105+
**A:** Yes, most panels can be collapsed or hidden through the View menu or panel controls. Customize your workspace for maximum efficiency.
106+
107+
### Q: How do I reset the interface to default?
108+
**A:** Go to Settings > Reset Layout, or clear your browser's local storage for the editor domain.
109+
110+
## Integration and Deployment
111+
112+
### Q: How do I run scripts outside the editor?
113+
**A:** Scripts created in the editor are JSON files that can be executed by any compatible runtime. Check your deployment documentation for specific runtime requirements.
114+
115+
### Q: Can I integrate the editor into my own application?
116+
**A:** The editor is designed to be embeddable. Refer to the integration documentation for API details and embedding instructions.
117+
118+
### Q: How do I handle different environments (dev, test, prod)?
119+
**A:** Use variables and configuration activities to make scripts environment-agnostic. Set environment-specific values through external configuration rather than hardcoding them in scripts.
120+
121+
## Getting Help
122+
123+
### Q: Where can I find more detailed documentation?
124+
**A:** Check the other documentation sections:
125+
- User Guide for comprehensive tutorials
126+
- Quick Reference for syntax and shortcuts
127+
- Troubleshooting Guide for common issues
128+
- Walkthrough for step-by-step examples
129+
130+
### Q: How do I report bugs or request features?
131+
**A:** Contact your system administrator or development team with detailed descriptions of issues or enhancement requests.
132+
133+
### Q: Are there video tutorials available?
134+
**A:** Check with your organization for training materials and video tutorials specific to your deployment and use cases.

docs/editor-quick-reference.md

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# TrackMan App Scripting Editor - Quick Reference
2+
3+
## Keyboard Shortcuts
4+
5+
### General
6+
- `Ctrl + S` - Save current script
7+
- `Ctrl + O` - Open script file
8+
- `Ctrl + N` - New script
9+
- `Ctrl + Z` - Undo
10+
- `Ctrl + Y` - Redo
11+
- `F5` - Run/Execute script
12+
- `F11` - Toggle fullscreen mode
13+
14+
### Navigation
15+
- `Ctrl + F` - Find in current file
16+
- `Ctrl + H` - Find and replace
17+
- `Ctrl + G` - Go to line
18+
- `Ctrl + P` - Quick file open
19+
- `Ctrl + Shift + P` - Command palette
20+
21+
### Code Editing
22+
- `Ctrl + /` - Toggle line comment
23+
- `Ctrl + Shift + /` - Toggle block comment
24+
- `Tab` - Indent selected lines
25+
- `Shift + Tab` - Unindent selected lines
26+
- `Ctrl + D` - Duplicate line
27+
- `Ctrl + Shift + K` - Delete line
28+
29+
## UI Components Quick Reference
30+
31+
### Toolbar Actions
32+
- **New** - Create new script
33+
- **Open** - Load existing script
34+
- **Save** - Save current script
35+
- **Download** - Export script as JSON
36+
- **Run** - Execute script
37+
- **Settings** - Open configuration panel
38+
39+
### Side Panels
40+
- **Activities Panel** - Drag and drop script activities
41+
- **Properties Panel** - Configure selected activity
42+
- **Variables Panel** - Manage script variables
43+
- **Debug Panel** - View execution logs and errors
44+
45+
### Activity Categories
46+
- **Input/Output** - Data collection and display
47+
- **Logic** - Conditional statements and loops
48+
- **Math** - Calculations and formulas
49+
- **Navigation** - Flow control
50+
- **Custom** - User-defined activities
51+
52+
## Script Structure
53+
54+
### Basic Script Template
55+
```json
56+
{
57+
"name": "My Script",
58+
"version": "1.0.0",
59+
"activities": [
60+
{
61+
"id": "start",
62+
"type": "start",
63+
"next": "activity1"
64+
},
65+
{
66+
"id": "activity1",
67+
"type": "input",
68+
"properties": {
69+
"prompt": "Enter value:",
70+
"variable": "userInput"
71+
},
72+
"next": "end"
73+
},
74+
{
75+
"id": "end",
76+
"type": "end"
77+
}
78+
]
79+
}
80+
```
81+
82+
### Common Activity Types
83+
- `start` - Script entry point
84+
- `end` - Script termination
85+
- `input` - User input collection
86+
- `output` - Display information
87+
- `condition` - If/else logic
88+
- `loop` - Repetitive operations
89+
- `calculation` - Mathematical operations
90+
- `variable` - Variable assignment
91+
92+
## Common Properties
93+
94+
### All Activities
95+
- `id` - Unique identifier
96+
- `type` - Activity type
97+
- `name` - Display name (optional)
98+
- `description` - Activity description (optional)
99+
- `next` - Next activity ID
100+
101+
### Input Activities
102+
- `prompt` - Text shown to user
103+
- `variable` - Variable to store input
104+
- `dataType` - Expected data type
105+
- `required` - Whether input is mandatory
106+
107+
### Output Activities
108+
- `message` - Text to display
109+
- `format` - Display format (text, html, markdown)
110+
111+
### Condition Activities
112+
- `condition` - Boolean expression
113+
- `trueNext` - Activity if condition is true
114+
- `falseNext` - Activity if condition is false
115+
116+
## Variables
117+
118+
### Declaration
119+
Variables are automatically declared when first used in activities.
120+
121+
### Naming Rules
122+
- Must start with letter or underscore
123+
- Can contain letters, numbers, underscores
124+
- Case sensitive
125+
- No spaces or special characters
126+
127+
### Data Types
128+
- `string` - Text values
129+
- `number` - Numeric values
130+
- `boolean` - True/false values
131+
- `array` - List of values
132+
- `object` - Complex data structures
133+
134+
## Error Messages
135+
136+
### Common Errors
137+
- **"Activity not found"** - Invalid activity ID reference
138+
- **"Circular reference detected"** - Activities reference each other in a loop
139+
- **"Variable not defined"** - Using undefined variable
140+
- **"Invalid JSON syntax"** - Malformed script structure
141+
- **"Missing required property"** - Activity missing mandatory property
142+
143+
### Debugging Tips
144+
1. Check activity IDs for typos
145+
2. Verify all `next` references point to valid activities
146+
3. Ensure variables are defined before use
147+
4. Validate JSON syntax
148+
5. Use debug panel to trace execution
149+
150+
## File Operations
151+
152+
### Supported Formats
153+
- `.json` - Native script format
154+
- `.txt` - Plain text export
155+
- `.zip` - Compressed script package
156+
157+
### Import/Export
158+
- Scripts are saved as JSON files
159+
- Can be shared between users
160+
- Version information is preserved
161+
- Activity configurations are maintained
162+
163+
## Best Practices
164+
165+
### Script Organization
166+
- Use descriptive activity names
167+
- Group related activities
168+
- Add comments and descriptions
169+
- Keep scripts modular and focused
170+
171+
### Performance
172+
- Minimize nested loops
173+
- Use efficient data structures
174+
- Cache frequently used values
175+
- Optimize condition checks
176+
177+
### Maintenance
178+
- Regular backups
179+
- Version control
180+
- Document changes
181+
- Test thoroughly before deployment

0 commit comments

Comments
 (0)