interaqt 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/agent/.claude/agents/code-generation-handler.md +2 -0
  2. package/agent/.claude/agents/computation-generation-handler.md +1 -0
  3. package/agent/.claude/agents/implement-design-handler.md +4 -13
  4. package/agent/.claude/agents/requirements-analysis-handler.md +46 -14
  5. package/agent/agentspace/knowledge/generator/api-reference.md +3378 -0
  6. package/agent/agentspace/knowledge/generator/basic-interaction-generation.md +377 -0
  7. package/agent/agentspace/knowledge/generator/computation-analysis.md +307 -0
  8. package/agent/agentspace/knowledge/generator/computation-implementation.md +959 -0
  9. package/agent/agentspace/knowledge/generator/data-analysis.md +463 -0
  10. package/agent/agentspace/knowledge/generator/entity-relation-generation.md +395 -0
  11. package/agent/agentspace/knowledge/generator/permission-implementation.md +460 -0
  12. package/agent/agentspace/knowledge/generator/permission-test-implementation.md +870 -0
  13. package/agent/agentspace/knowledge/generator/test-implementation.md +674 -0
  14. package/agent/agentspace/knowledge/usage/00-mindset-shift.md +322 -0
  15. package/agent/agentspace/knowledge/usage/01-core-concepts.md +131 -0
  16. package/agent/agentspace/knowledge/usage/02-define-entities-properties.md +407 -0
  17. package/agent/agentspace/knowledge/usage/03-entity-relations.md +599 -0
  18. package/agent/agentspace/knowledge/usage/04-reactive-computations.md +2186 -0
  19. package/agent/agentspace/knowledge/usage/05-interactions.md +1411 -0
  20. package/agent/agentspace/knowledge/usage/06-attributive-permissions.md +10 -0
  21. package/agent/agentspace/knowledge/usage/07-payload-parameters.md +593 -0
  22. package/agent/agentspace/knowledge/usage/08-activities.md +863 -0
  23. package/agent/agentspace/knowledge/usage/09-filtered-entities.md +784 -0
  24. package/agent/agentspace/knowledge/usage/10-async-computations.md +734 -0
  25. package/agent/agentspace/knowledge/usage/11-global-dictionaries.md +942 -0
  26. package/agent/agentspace/knowledge/usage/12-data-querying.md +1033 -0
  27. package/agent/agentspace/knowledge/usage/13-testing.md +1201 -0
  28. package/agent/agentspace/knowledge/usage/14-api-reference.md +1606 -0
  29. package/agent/agentspace/knowledge/usage/15-entity-crud-patterns.md +1122 -0
  30. package/agent/agentspace/knowledge/usage/16-frontend-page-design-guide.md +485 -0
  31. package/agent/agentspace/knowledge/usage/17-performance-optimization.md +283 -0
  32. package/agent/agentspace/knowledge/usage/18-api-exports-reference.md +176 -0
  33. package/agent/agentspace/knowledge/usage/19-common-anti-patterns.md +563 -0
  34. package/agent/agentspace/knowledge/usage/README.md +148 -0
  35. package/package.json +1 -1
@@ -0,0 +1,485 @@
1
+ # Frontend Page Design Guide
2
+
3
+ ## Overview
4
+
5
+ This document guides how to systematically design frontend page architecture and user interaction flows based on the backend definitions (entities, relations, interactions, etc.) of interaqt applications. It focuses on conceptual design aspects such as page division, user interaction points, and data flow, rather than specific technical implementation.
6
+
7
+ ## Design Principles
8
+
9
+ ### 1. Data-Driven Page Design
10
+ - **Entity-Centric**: Each core entity typically requires corresponding management pages
11
+ - **Relations Determine Navigation**: Relationships between entities determine page navigation and data associations
12
+ - **Interaction Maps to Functions**: Each Interaction should have a corresponding operation entry in the interface
13
+
14
+ ### 2. Reactive Data Display
15
+ - **Reactive Computations**: All properties with `computation` should be displayed in real-time in the interface
16
+ - **State-Aware**: Dynamically display different operation options based on entity state
17
+ - **Permission Control**: Control interface element visibility based on Attributive definitions
18
+
19
+ ### 3. User Experience Consistency
20
+ - **Operation Feedback**: Every interaction operation should have clear feedback
21
+ - **Status Indication**: Clearly display current state and executable operations
22
+ - **Error Handling**: Friendly error messages and recovery guidance
23
+
24
+ ---
25
+
26
+ ## Page Design Methodology
27
+
28
+ ### Step 1: Entity Analysis Method
29
+
30
+ #### 1.1 Identify Core Entities
31
+ Extract all entities from the application definition and categorize by importance:
32
+
33
+ **Primary Entities**: Core business objects directly operated by users
34
+ - Usually require complete CRUD pages
35
+ - Need list page, detail page, create/edit page
36
+
37
+ **Supporting Entities**: Objects that support business processes
38
+ - Usually embedded as components in primary entity pages
39
+ - May only need simple management interfaces
40
+
41
+ **System Entities**: Framework or system-level objects
42
+ - Usually don't need independent pages
43
+ - Handled in system settings or admin backend
44
+
45
+ #### 1.2 Entity Page Planning Template
46
+
47
+ **For each primary entity, consider the following pages:**
48
+
49
+ ```
50
+ Entity Name: [EntityName]
51
+
52
+ Required Pages:
53
+ □ List Page ([EntityName]ListPage) - Display entity collection
54
+ □ Detail Page ([EntityName]DetailPage) - Display complete information of single entity
55
+ □ Create Page (Create[EntityName]Page) - Create new entity
56
+ □ Edit Page (Edit[EntityName]Page) - Modify existing entity
57
+
58
+ Optional Pages:
59
+ □ Search Page ([EntityName]SearchPage) - Complex search functionality
60
+ □ Analytics Page ([EntityName]AnalyticsPage) - Data analysis display
61
+ ```
62
+
63
+ ### Step 2: Relationship Navigation Design
64
+
65
+ #### 2.1 Relationship Types and Navigation Patterns
66
+
67
+ **One-to-One Relationship (1:1)**
68
+ - Embed associated entity information in main entity page
69
+ - Provide quick jump entry to associated entity
70
+
71
+ **One-to-Many Relationship (1:n)**
72
+ - Display preview list of "many" in the "one" detail page
73
+ - Provide "View All" link to jump to filtered list page
74
+
75
+ **Many-to-Many Relationship (n:n)**
76
+ - Bidirectional navigation: both entity pages should display association information
77
+ - Provide operation entries for adding/removing associations
78
+
79
+ **Symmetric Relationship**
80
+ - Special many-to-many relationship, pay attention to state consistency
81
+ - Usually used for friend relationships, mutual following, etc.
82
+
83
+ #### 2.2 Relationship Navigation Examples
84
+
85
+ ```
86
+ User 1:n Post
87
+ ├─ User Detail Page: Display preview list of user's posts
88
+ ├─ Post Detail Page: Display author information, click to jump to user detail
89
+ └─ User Posts List Page: Display all posts by the user
90
+
91
+ User n:n Tag
92
+ ├─ User Detail Page: Display user's tags, support add/delete
93
+ ├─ Tag Detail Page: Display list of users using this tag
94
+ └─ Tag Users List Page: Display all users with this tag
95
+ ```
96
+
97
+ ### Step 3: Interaction Operation Mapping
98
+
99
+ #### 3.1 Interaction Types and Interface Positions
100
+
101
+ **Create Interactions**
102
+ - Primary position: Dedicated creation page
103
+ - Secondary position: "New" button on list page, quick create form
104
+
105
+ **Update Interactions**
106
+ - Primary position: Edit page, edit mode on detail page
107
+ - Secondary position: Quick edit on list page, inline editing
108
+
109
+ **Delete Interactions**
110
+ - Primary position: Delete button on detail page, edit page
111
+ - Secondary position: Batch delete on list page, context menu
112
+
113
+ **Query Interactions**
114
+ - Primary position: List page, search page
115
+ - Secondary position: Filter components, search boxes
116
+
117
+ **Business Process Interactions**
118
+ - Design dedicated operation buttons based on business logic
119
+ - Consider state machine state transitions
120
+
121
+ #### 3.2 Interaction Operation Design Template
122
+
123
+ ```
124
+ Interaction Name: [InteractionName]
125
+ Operation Type: [Create/Update/Delete/Query/Business]
126
+
127
+ Trigger Positions:
128
+ □ Primary Entry: [Page Name - Specific Location]
129
+ □ Secondary Entry: [Page Name - Specific Location]
130
+
131
+ Prerequisites:
132
+ □ User Permissions: [Describe permission requirements]
133
+ □ Data State: [Describe necessary data state]
134
+ □ Business Rules: [Describe business constraints]
135
+
136
+ Operation Flow:
137
+ 1. [Step 1 description]
138
+ 2. [Step 2 description]
139
+ 3. [Step n description]
140
+
141
+ Operation Results:
142
+ □ Success Feedback: [Describe interface changes after success]
143
+ □ Failure Handling: [Describe error messages on failure]
144
+ ```
145
+
146
+ ---
147
+
148
+ ## Common Page Patterns
149
+
150
+ ### 1. List Page Pattern
151
+
152
+ #### 1.1 Basic Structure
153
+ ```
154
+ Page Title + Action Button Area
155
+ ├─ Global Actions: New, Batch Operations, Import/Export
156
+ ├─ Filter Area: Search box, filters, sort options
157
+ ├─ List Area: Data table/card list
158
+ └─ Pagination Area: Pagination controls, display count selection
159
+ ```
160
+
161
+ #### 1.2 Design Points
162
+ - **Filter Design**: Design filter conditions based on entity properties and relationships
163
+ - **Sort Options**: Prioritize support for common sorts like time, popularity, name
164
+ - **Batch Operations**: Consider which operations are suitable for batch execution
165
+ - **Status Display**: Display different visual styles based on entity status
166
+
167
+ #### 1.3 Reactive Data
168
+ - Auto-update computed properties of list items (like statistics)
169
+ - Real-time reflection of entity state changes
170
+ - Support real-time updates for list item additions, deletions, and modifications
171
+
172
+ ### 2. Detail Page Pattern
173
+
174
+ #### 2.1 Basic Structure
175
+ ```
176
+ Entity Basic Information Area
177
+ ├─ Primary property display
178
+ ├─ Reactive computed data display
179
+ ├─ Status indicators
180
+ └─ Primary action buttons
181
+
182
+ Associated Data Area
183
+ ├─ One-to-many relationship data preview
184
+ ├─ Many-to-many relationship data display
185
+ └─ Related operation entries
186
+
187
+ Operation History Area (Optional)
188
+ ├─ State change records
189
+ ├─ Operation logs
190
+ └─ Approval processes (if applicable)
191
+ ```
192
+
193
+ #### 2.2 Design Points
194
+ - **Permission Control**: Dynamically display action buttons based on Attributive
195
+ - **State Awareness**: Display different operation options based on entity state
196
+ - **Association Display**: Reasonably display associated entities, avoid information overload
197
+ - **Operation Feedback**: Clear operation result notifications
198
+
199
+ ### 3. Create/Edit Page Pattern
200
+
201
+ #### 3.1 Basic Structure
202
+ ```
203
+ Form Area
204
+ ├─ Basic property input
205
+ ├─ Associated data selection
206
+ ├─ Optional property configuration
207
+ └─ Form validation prompts
208
+
209
+ Preview Area (Optional)
210
+ ├─ Real-time preview effects
211
+ └─ Formatted display
212
+
213
+ Action Area
214
+ ├─ Save, Cancel buttons
215
+ ├─ Save draft functionality (if applicable)
216
+ └─ Reset form functionality
217
+ ```
218
+
219
+ #### 3.2 Design Points
220
+ - **Form Validation**: Based on PayloadItem validation rules
221
+ - **Association Selection**: Provide friendly associated entity selection interface
222
+ - **Draft Saving**: Provide draft functionality for complex content
223
+ - **Progress Saving**: Support step-by-step saving for long forms
224
+
225
+ ---
226
+
227
+ ## Special Functionality Page Design
228
+
229
+ ### 1. Workflow Pages
230
+
231
+ When the application includes Activity definitions, consider workflow-related pages:
232
+
233
+ #### 1.1 Process Instance Pages
234
+ - **Process Overview**: Display current state, progress indicators
235
+ - **Executable Operations**: Display available interactions based on current state
236
+ - **History Records**: Display state transition history and operation records
237
+ - **Participant Information**: Display users and roles involved in the process
238
+
239
+ #### 1.2 Task List Pages
240
+ - **Pending Tasks**: Tasks requiring processing by current user
241
+ - **Completed Tasks**: History of tasks processed by user
242
+ - **Task Filtering**: Filter by process type, status, time, etc.
243
+ - **Batch Operations**: Support batch approval and other operations
244
+
245
+ ### 2. Statistics and Analysis Pages
246
+
247
+ For applications with complex reactive computations:
248
+
249
+ #### 2.1 Data Dashboard
250
+ - **Key Indicators**: Display important computed property data
251
+ - **Trend Charts**: Show data changes over time
252
+ - **Comparative Analysis**: Data comparison across different dimensions
253
+ - **Real-time Updates**: Real-time data refresh based on reactive computations
254
+
255
+ #### 2.2 Report Pages
256
+ - **Data Export**: Support data export in various formats
257
+ - **Custom Reports**: Allow users to customize statistical dimensions
258
+ - **Scheduled Reports**: Automatic report generation and sending functionality
259
+
260
+ ### 3. Permission Management Pages
261
+
262
+ For applications with complex permission control:
263
+
264
+ #### 3.1 Role Management Pages
265
+ - **Role Definition**: Create and edit user roles
266
+ - **Permission Assignment**: Assign specific permissions to roles
267
+ - **User Assignment**: Assign roles to users
268
+
269
+ #### 3.2 Permission Audit Pages
270
+ - **Permission Checking**: Check user permissions for specific resources
271
+ - **Operation Logs**: Record permission-related operation history
272
+ - **Exception Monitoring**: Permission exceptions and security event monitoring
273
+
274
+ ---
275
+
276
+ ## Inter-Page Navigation Design
277
+
278
+ ### 1. Navigation Hierarchy
279
+
280
+ #### 1.1 Main Navigation Design
281
+ Design main navigation based on application's core entities and functional modules:
282
+
283
+ ```
284
+ Main Navigation Example:
285
+ ├─ Home/Dashboard
286
+ ├─ [Primary Entity 1] Management
287
+ ├─ [Primary Entity 2] Management
288
+ ├─ [Special Function Module]
289
+ ├─ Settings/Configuration
290
+ └─ User Center
291
+ ```
292
+
293
+ #### 1.2 Breadcrumb Navigation
294
+ Provide breadcrumb navigation for complex page hierarchies:
295
+
296
+ ```
297
+ Breadcrumb Examples:
298
+ Home > User Management > User Detail > Edit User
299
+ Home > Content Management > Article List > Article Detail
300
+ ```
301
+
302
+ ### 2. Page Jump Rules
303
+
304
+ #### 2.1 Entity Association Jumps
305
+ - Clicking associated entity B from entity A detail page jumps to entity B detail page
306
+ - Clicking "View Associated Entity B" from entity A list page jumps to filtered entity B list page
307
+
308
+ #### 2.2 Post-Operation Jumps
309
+ - After successful creation, jump to new entity's detail page
310
+ - After successful editing, jump to entity detail page
311
+ - After successful deletion, jump to entity list page
312
+
313
+ #### 2.3 Permission-Restricted Jumps
314
+ - Jump to permission prompt page when access is unauthorized
315
+ - Jump to login page when login times out
316
+ - Prompt for permission application when specific role is required
317
+
318
+ ---
319
+
320
+ ## Reactive Data Display Strategy
321
+
322
+ ### 1. Real-time Data Updates
323
+
324
+ #### 1.1 Computed Property Display
325
+ For properties containing `computation`:
326
+ - **Real-time Display**: Real-time display of computation results in interface
327
+ - **Change Indicators**: Provide visual feedback when data changes
328
+ - **Loading States**: Display loading indicators during computation
329
+
330
+ #### 1.2 Associated Data Synchronization
331
+ - **Cascading Updates**: Auto-update display when related entities change
332
+ - **State Synchronization**: Maintain data consistency across all related pages
333
+ - **Conflict Handling**: Handle concurrent modification conflicts
334
+
335
+ ### 2. State-Driven Interface
336
+
337
+ #### 2.1 Entity State Display
338
+ - **Status Indicators**: Clearly display current entity status
339
+ - **Status Descriptions**: Provide explanatory text for status meanings
340
+ - **Transition Hints**: Display possible state transition operations
341
+
342
+ #### 2.2 Conditional Operation Display
343
+ Based on permission control defined by Attributive:
344
+ - **Dynamic Buttons**: Dynamically display action buttons based on permissions
345
+ - **Disabled States**: Show disabled operations when conditions aren't met
346
+ - **Permission Hints**: Explain why certain operations are unavailable
347
+
348
+ ---
349
+
350
+ ## User Interaction Flow Design
351
+
352
+ ### 1. Typical Interaction Flows
353
+
354
+ #### 1.1 Creation Flow
355
+ ```
356
+ Create New Entity Flow:
357
+ 1. User clicks "New" button on list page
358
+ 2. Jump to creation page
359
+ 3. User fills in necessary information
360
+ 4. System validates data validity
361
+ 5. Call creation interaction
362
+ 6. Display creation result
363
+ 7. Jump to new entity detail page
364
+ ```
365
+
366
+ #### 1.2 Edit Flow
367
+ ```
368
+ Edit Entity Flow:
369
+ 1. User clicks "Edit" button on detail page
370
+ 2. Page switches to edit mode or jumps to edit page
371
+ 3. User modifies information
372
+ 4. System validates modified data
373
+ 5. Call update interaction
374
+ 6. Display update result
375
+ 7. Return to detail page or refresh current page
376
+ ```
377
+
378
+ #### 1.3 Association Operation Flow
379
+ ```
380
+ Establish Association Flow:
381
+ 1. User initiates association operation on entity A page
382
+ 2. System displays list of associable entity B instances
383
+ 3. User selects target entity B
384
+ 4. System calls association creation interaction
385
+ 5. Display association result
386
+ 6. Update association information display on related pages
387
+ ```
388
+
389
+ ### 2. Complex Business Flows
390
+
391
+ #### 2.1 Multi-Step Operations
392
+ For complex business operations:
393
+ - **Step Indicators**: Display current progress and remaining steps
394
+ - **Data Saving**: Support draft saving in intermediate steps
395
+ - **Back to Modify**: Support returning to previous step for modifications
396
+ - **Final Confirmation**: Provide operation summary and final confirmation
397
+
398
+ #### 2.2 Approval Processes
399
+ For business processes involving approval:
400
+ - **Status Tracking**: Display approval progress and current stage
401
+ - **Operation History**: Display historical approval comments and operations
402
+ - **Notification Mechanism**: Message notifications for relevant personnel
403
+ - **Permission Control**: Different roles see different operation options
404
+
405
+ ---
406
+
407
+ ## Error Handling and User Feedback
408
+
409
+ ### 1. Error Handling Strategy
410
+
411
+ #### 1.1 Data Validation Errors
412
+ - **Real-time Validation**: Immediate validation and prompts during input
413
+ - **Submit Validation**: Unified display of all errors upon submission
414
+ - **Error Location**: Highlight error fields and scroll to error position
415
+ - **Correction Suggestions**: Provide specific correction suggestions
416
+
417
+ #### 1.2 Permission Errors
418
+ - **Friendly Messages**: Explain permission restrictions in plain language
419
+ - **Solutions**: Provide ways to obtain permissions
420
+ - **Contact Information**: Provide administrator contact information
421
+ - **Alternative Operations**: Recommend alternative operations users can perform
422
+
423
+ #### 1.3 System Errors
424
+ - **Error Recovery**: Provide retry mechanisms
425
+ - **State Preservation**: Save user's current operation state
426
+ - **Error Reporting**: Allow users to report error information
427
+ - **Fallback Solutions**: Provide alternative solutions for basic functionality
428
+
429
+ ### 2. Operation Feedback Design
430
+
431
+ #### 2.1 Immediate Feedback
432
+ - **Loading States**: Loading prompts during operations
433
+ - **Progress Display**: Progress bars for long-running operations
434
+ - **Status Changes**: Immediate status updates of interface elements
435
+ - **Audio Feedback**: Sound prompts for important operations (optional)
436
+
437
+ #### 2.2 Result Feedback
438
+ - **Success Messages**: Confirmation messages for successful operations
439
+ - **Failure Explanations**: Detailed reasons for operation failures
440
+ - **Impact Scope**: Explain operation's effect on other data
441
+ - **Next Steps**: Suggest user's next actions
442
+
443
+ ---
444
+
445
+ ## Design Checklist
446
+
447
+ After completing page design, use the following checklist to verify design completeness:
448
+
449
+ ### 1. Entity Coverage Check
450
+ - [ ] Each primary entity has corresponding management pages
451
+ - [ ] Each entity's CRUD operations have interface entries
452
+ - [ ] Relationships between entities have navigation paths
453
+ - [ ] All computed properties are displayed in interface
454
+
455
+ ### 2. Interaction Coverage Check
456
+ - [ ] Each interaction has corresponding interface operation
457
+ - [ ] Interaction permission control is reflected in interface
458
+ - [ ] Interaction parameters have input methods in interface
459
+ - [ ] Interaction results have feedback in interface
460
+
461
+ ### 3. User Experience Check
462
+ - [ ] Users can complete all core business processes
463
+ - [ ] Navigation paths between pages are clear and reasonable
464
+ - [ ] Error situations have appropriate handling and prompts
465
+ - [ ] Operation feedback is timely and clear
466
+
467
+ ### 4. Reactive Feature Check
468
+ - [ ] Reactive computation data can update in real-time
469
+ - [ ] Data across related pages remains synchronized
470
+ - [ ] Status changes are correctly reflected in interface
471
+ - [ ] Permission changes can dynamically update interface elements
472
+
473
+ ---
474
+
475
+ ## Summary
476
+
477
+ Frontend page design based on the interaqt framework should:
478
+
479
+ 1. **Data-Centric**: Design page structure around entities and relationships
480
+ 2. **Reactive-First**: Fully utilize the framework's reactive computation features
481
+ 3. **Permission-Aware**: Dynamically adjust interface based on permission control
482
+ 4. **State-Driven**: Provide corresponding operation options based on entity status
483
+ 5. **User-Friendly**: Provide clear navigation and timely feedback
484
+
485
+ Through systematic analysis of the application's backend definitions, you can design frontend interfaces that both fully utilize framework features and conform to user usage habits. The key is understanding the data model and business logic, then transforming them into intuitive user interaction experiences.