speccrew 0.1.0
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.
- package/.speccrew/agents/speccrew-feature-designer.md +142 -0
- package/.speccrew/agents/speccrew-product-manager.md +61 -0
- package/.speccrew/agents/speccrew-system-designer.md +200 -0
- package/.speccrew/agents/speccrew-system-developer.md +238 -0
- package/.speccrew/agents/speccrew-task-worker.md +80 -0
- package/.speccrew/agents/speccrew-team-leader.md +92 -0
- package/.speccrew/agents/speccrew-test-manager.md +313 -0
- package/.speccrew/skills/speccrew-create-agents/SKILL.md +98 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/designer-agent.md +54 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/dev-agent.md +79 -0
- package/.speccrew/skills/speccrew-create-agents/templates/agents/test-agent.md +80 -0
- package/.speccrew/skills/speccrew-dev-backend/SKILL.md +205 -0
- package/.speccrew/skills/speccrew-dev-backend/templates/TASK-RECORD-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-dev-desktop/SKILL.md +258 -0
- package/.speccrew/skills/speccrew-dev-desktop/templates/TASK-RECORD-TEMPLATE.md +161 -0
- package/.speccrew/skills/speccrew-dev-frontend/SKILL.md +202 -0
- package/.speccrew/skills/speccrew-dev-frontend/templates/TASK-RECORD-TEMPLATE.md +115 -0
- package/.speccrew/skills/speccrew-dev-mobile/SKILL.md +200 -0
- package/.speccrew/skills/speccrew-dev-mobile/templates/TASK-RECORD-TEMPLATE.md +125 -0
- package/.speccrew/skills/speccrew-fd-api-contract/SKILL.md +73 -0
- package/.speccrew/skills/speccrew-fd-api-contract/templates/API-CONTRACT-TEMPLATE.md +96 -0
- package/.speccrew/skills/speccrew-fd-feature-design/SKILL.md +395 -0
- package/.speccrew/skills/speccrew-fd-feature-design/templates/FEATURE-SPEC-TEMPLATE.md +387 -0
- package/.speccrew/skills/speccrew-get-timestamp/SKILL.md +80 -0
- package/.speccrew/skills/speccrew-get-timestamp/scripts/get-timestamp.js +35 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/SKILL.md +1116 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-FASTAPI.md +462 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-JAVA.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE-NET.md +464 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/FEATURE-DETAIL-TEMPLATE.md +480 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-api-analyze/templates/MODULE-OVERVIEW-TEMPLATE.md +367 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/SKILL.md +667 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/STATUS-FORMATS.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/batch-orchestrator.js +176 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-next-batch.js +150 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/get-pending-features.js +106 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/mark-stale.js +249 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/process-batch-results.js +848 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-dispatch/scripts/update-feature-status.js +226 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/SKILL.md +264 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/examples/features.json +34 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/generate-inventory.js +867 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-init-features/scripts/test-inventory.js +26 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/SKILL.md +165 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/apply-module-mapping.js +208 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/extract-module-summary.js +180 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-module-classify/scripts/reindex-modules.js +358 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/SKILL.md +1055 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-DESKTOP.md +303 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-ELECTRON.md +327 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MINIAPP.md +292 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI-MOBILE.md +281 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-analyze/templates/FEATURE-DETAIL-TEMPLATE-UI.md +324 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/SKILL.md +270 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/COMPONENT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/LAYOUT-PATTERN-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-bizs-ui-style-extract/templates/PAGE-TYPE-TEMPLATE.md +33 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/SKILL.md +229 -0
- package/.speccrew/skills/speccrew-knowledge-graph-query/scripts/graph-query.js +549 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/SKILL.md +181 -0
- package/.speccrew/skills/speccrew-knowledge-graph-write/scripts/graph-write.js +651 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/SKILL.md +305 -0
- package/.speccrew/skills/speccrew-knowledge-module-summarize/templates/MODULE-OVERVIEW-TEMPLATE.md +400 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/SKILL.md +351 -0
- package/.speccrew/skills/speccrew-knowledge-system-summarize/templates/SYSTEM-OVERVIEW-TEMPLATE.md +294 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/SKILL.md +683 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/STATUS-FORMATS.md +550 -0
- package/.speccrew/skills/speccrew-knowledge-techs-dispatch/templates/techs-manifest-EXAMPLE.json +35 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/SKILL.md +1087 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/ARCHITECTURE-TEMPLATE.md +240 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COLOR-SYSTEM-TEMPLATE.md +68 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/COMPONENT-LIBRARY-TEMPLATE.md +86 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-BUILD-TEMPLATE.md +466 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DATA-TEMPLATE.md +432 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DESIGN-TEMPLATE.md +1209 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-DEV-TEMPLATE.md +1433 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-SYSTEM-TEST-TEMPLATE.md +1052 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/CONVENTIONS-UNIT-TEST-TEMPLATE.md +946 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/INDEX-TEMPLATE.md +29 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-LAYOUTS-TEMPLATE.md +69 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +74 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate/templates/TECH-STACK-TEMPLATE.md +232 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-conventions/SKILL.md +628 -0
- package/.speccrew/skills/speccrew-knowledge-techs-generate-ui-style/SKILL.md +392 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/SKILL.md +489 -0
- package/.speccrew/skills/speccrew-knowledge-techs-index/templates/INDEX-TEMPLATE.md +243 -0
- package/.speccrew/skills/speccrew-knowledge-techs-init/SKILL.md +269 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/SKILL.md +562 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/BUSINESS-COMPONENTS-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMMON-COMPONENTS-TEMPLATE.md +177 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-INDIVIDUAL-TEMPLATE.md +80 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/COMPONENT-LIBRARY-TEMPLATE.md +118 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-INDIVIDUAL-TEMPLATE.md +97 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/LAYOUT-PATTERNS-TEMPLATE.md +208 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/NAVIGATION-PATTERNS-TEMPLATE.md +157 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-INDIVIDUAL-TEMPLATE.md +123 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/PAGE-TYPE-SUMMARY-TEMPLATE.md +58 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/SPACING-TEMPLATE.md +119 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/STYLE-SYSTEM-TEMPLATE.md +117 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/TYPOGRAPHY-TEMPLATE.md +107 -0
- package/.speccrew/skills/speccrew-knowledge-techs-ui-analyze/templates/UI-STYLE-GUIDE-TEMPLATE.md +171 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/SKILL.md +434 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/BIZS-MODELING-TEMPLATE.md +332 -0
- package/.speccrew/skills/speccrew-pm-requirement-analysis/templates/PRD-TEMPLATE.md +200 -0
- package/.speccrew/skills/speccrew-pm-requirement-assess/SKILL.md +195 -0
- package/.speccrew/skills/speccrew-project-diagnosis/SKILL.md +208 -0
- package/.speccrew/skills/speccrew-project-diagnosis/templates/DIAGNOSIS-REPORT-TEMPLATE.md +202 -0
- package/.speccrew/skills/speccrew-sd-backend/SKILL.md +188 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/INDEX-TEMPLATE.md +85 -0
- package/.speccrew/skills/speccrew-sd-backend/templates/SD-BACKEND-TEMPLATE.md +269 -0
- package/.speccrew/skills/speccrew-sd-desktop/SKILL.md +192 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/INDEX-TEMPLATE.md +271 -0
- package/.speccrew/skills/speccrew-sd-desktop/templates/SD-DESKTOP-TEMPLATE.md +673 -0
- package/.speccrew/skills/speccrew-sd-frontend/SKILL.md +176 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/INDEX-TEMPLATE.md +184 -0
- package/.speccrew/skills/speccrew-sd-frontend/templates/SD-FRONTEND-TEMPLATE.md +382 -0
- package/.speccrew/skills/speccrew-sd-mobile/SKILL.md +189 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/INDEX-TEMPLATE.md +219 -0
- package/.speccrew/skills/speccrew-sd-mobile/templates/SD-MOBILE-TEMPLATE.md +534 -0
- package/.speccrew/skills/speccrew-test-case-design/SKILL.md +284 -0
- package/.speccrew/skills/speccrew-test-case-design/templates/TEST-CASE-DESIGN-TEMPLATE.md +263 -0
- package/.speccrew/skills/speccrew-test-code-gen/SKILL.md +313 -0
- package/.speccrew/skills/speccrew-test-code-gen/templates/TEST-CODE-PLAN-TEMPLATE.md +180 -0
- package/.speccrew/skills/speccrew-test-execute/SKILL.md +283 -0
- package/.speccrew/skills/speccrew-test-execute/templates/BUG-REPORT-TEMPLATE.md +50 -0
- package/.speccrew/skills/speccrew-test-execute/templates/TEST-REPORT-TEMPLATE.md +57 -0
- package/.speccrew/skills/speccrew-workflow-diagnose/SKILL.md +155 -0
- package/LICENSE +21 -0
- package/README.ar.md +318 -0
- package/README.en.md +318 -0
- package/README.es.md +318 -0
- package/README.md +340 -0
- package/bin/cli.js +62 -0
- package/lib/commands/doctor.js +138 -0
- package/lib/commands/init.js +231 -0
- package/lib/commands/list.js +114 -0
- package/lib/commands/uninstall.js +117 -0
- package/lib/commands/update.js +351 -0
- package/lib/ide-adapters.js +73 -0
- package/lib/utils.js +104 -0
- package/package.json +28 -0
- package/workspace-template/docs/configs/document-templates.json +667 -0
- package/workspace-template/docs/configs/platform-mapping.json +194 -0
- package/workspace-template/docs/configs/tech-stack-mappings.json +313 -0
- package/workspace-template/docs/configs/validation-rules.json +87 -0
- package/workspace-template/docs/rules/mermaid-rule.md +114 -0
- package/workspace-template/docs/solutions/Agent/346/212/200/350/203/275/345/256/232/344/271/211+/351/234/200/346/261/202/346/226/207/346/241/243+UML/344/275/277/347/224/250/346/250/241/346/235/277/357/274/210ISA-95/345/205/255/346/256/265/345/274/217/350/236/215/345/220/210/347/211/210/357/274/211.md +586 -0
- package/workspace-template/docs/solutions/agent-knowledge-map.md +238 -0
- package/workspace-template/docs/solutions/bizs-knowledge-pipeline.md +678 -0
- package/workspace-template/docs/solutions/harness.md +410 -0
- package/workspace-template/docs/solutions/knowledge-incremental-sync-spec.md +943 -0
- package/workspace-template/docs/solutions/techs-knowledge-pipeline.md +803 -0
- package/workspace-template/docs/solutions/workspace-structure.md +318 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
|
|
2
|
+
# Feature Detail Design Template - [Feature Name]
|
|
3
|
+
|
|
4
|
+
> **Platform**: Desktop Application (WinForms/WPF/WinUI)
|
|
5
|
+
> **Tech Stack**: C# / .NET / XAML
|
|
6
|
+
|
|
7
|
+
## 1. Content Overview
|
|
8
|
+
|
|
9
|
+
name: {Feature Name}
|
|
10
|
+
|
|
11
|
+
description: Feature overview.
|
|
12
|
+
|
|
13
|
+
document-path: {documentPath}
|
|
14
|
+
source-path: {sourcePath}
|
|
15
|
+
|
|
16
|
+
## 2. Interface Prototype
|
|
17
|
+
|
|
18
|
+
<!-- AI-TAG: UI_PROTOTYPE -->
|
|
19
|
+
<!-- AI-NOTE: Desktop UI uses wider ASCII wireframes for window layout -->
|
|
20
|
+
<!-- AI-NOTE: Typical window size: 1024×768 or 1366×768 -->
|
|
21
|
+
<!-- AI-NOTE: ONLY draw prototype for the MAIN WINDOW defined in {{sourcePath}} -->
|
|
22
|
+
|
|
23
|
+
### 2.1 {Main Window Name}
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
27
|
+
│ □ [Window Title] ─ □ ✕ │ ← Title Bar
|
|
28
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
29
|
+
│ File Edit View Tools Help │ ← Menu Bar
|
|
30
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
31
|
+
│ ┌──────────┬──────────────────────────────────────────────────────┐ │
|
|
32
|
+
│ │ │ [Toolbar: New] [Open] [Save] [Delete] [Refresh] │ │ ← Toolbar
|
|
33
|
+
│ │ ├──────────────────────────────────────────────────────┤ │
|
|
34
|
+
│ │ │ Filter: [Keyword:________] [Status:▼] [Search] │ │ ← Filter Area
|
|
35
|
+
│ │ ├──────────────────────────────────────────────────────┤ │
|
|
36
|
+
│ │ │ │ │
|
|
37
|
+
│ │ Tree │ ┌────────────────────────────────────────────────┐ │ │
|
|
38
|
+
│ │ Panel │ │ No. │ Name │ Status │ Date │ Actions │ │ │
|
|
39
|
+
│ │ │ ├──────┼─────────┼─────────┼───────────┼─────────┤ │ │ ← Data Grid
|
|
40
|
+
│ │ │ │ 1 │ {Value} │ {Value} │ {Value} │ [Edit] │ │ │
|
|
41
|
+
│ │ │ │ 2 │ {Value} │ {Value} │ {Value} │ [Edit] │ │ │
|
|
42
|
+
│ │ │ │ ... │ ... │ ... │ ... │ ... │ │ │
|
|
43
|
+
│ │ │ └────────────────────────────────────────────────┘ │ │
|
|
44
|
+
│ │ │ │ │
|
|
45
|
+
│ │ │ Page: [1] [2] [3] ... Total: {X} records │ │ ← Pagination
|
|
46
|
+
│ │ │ │ │
|
|
47
|
+
│ └──────────┴──────────────────────────────────────────────────────┘ │
|
|
48
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
49
|
+
│ Status: Ready [Progress] │ ← Status Bar
|
|
50
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Modal Dialog Layout:**
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
┌─────────────────────────────────────────┐
|
|
57
|
+
│ [Dialog Title] [✕] │
|
|
58
|
+
├─────────────────────────────────────────┤
|
|
59
|
+
│ │
|
|
60
|
+
│ Field 1: [____________________] │
|
|
61
|
+
│ │
|
|
62
|
+
│ Field 2: [____________________] [▼] │
|
|
63
|
+
│ │
|
|
64
|
+
│ Field 3: [☑] Checkbox │
|
|
65
|
+
│ │
|
|
66
|
+
│ Notes: ┌────────────────────┐ │
|
|
67
|
+
│ │ │ │
|
|
68
|
+
│ │ Text Area │ │
|
|
69
|
+
│ │ │ │
|
|
70
|
+
│ └────────────────────┘ │
|
|
71
|
+
│ │
|
|
72
|
+
├─────────────────────────────────────────┤
|
|
73
|
+
│ [Cancel] [Save] │
|
|
74
|
+
└─────────────────────────────────────────┘
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Interface Element Description:**
|
|
78
|
+
|
|
79
|
+
| Area | Element | Control | Description | Interaction | Source Link |
|
|
80
|
+
|------|---------|---------|-------------|-------------|-------------|
|
|
81
|
+
| Menu | File Menu | MenuStrip | {Application menu} | Click | [Source](../../{sourcePath}) |
|
|
82
|
+
| Toolbar | New Button | ToolStripButton | {Create new} | Click | [Source](../../{sourcePath}) |
|
|
83
|
+
| Tree | Navigation | TreeView | {Navigate sections} | NodeClick | [Source](../../{sourcePath}) |
|
|
84
|
+
| Grid | Data Grid | DataGridView | {Display data} | CellClick/DoubleClick | [Source](../../{sourcePath}) |
|
|
85
|
+
| Status | Status Label | StatusStrip | {Show status} | - | [Source](../../{sourcePath}) |
|
|
86
|
+
|
|
87
|
+
**Desktop-Specific Interactions:**
|
|
88
|
+
|
|
89
|
+
| Interaction | Action | Description | Source |
|
|
90
|
+
|-------------|--------|-------------|--------|
|
|
91
|
+
| Click | Select/Activate | Mouse click | [Source](../../{sourcePath}) |
|
|
92
|
+
| DoubleClick | Open/Edit | Double click row | [Source](../../{sourcePath}) |
|
|
93
|
+
| RightClick | Context Menu | Show context menu | [Source](../../{sourcePath}) |
|
|
94
|
+
| DragDrop | Reorder | Drag and drop items | [Source](../../{sourcePath}) |
|
|
95
|
+
| Keyboard | Shortcut | Ctrl+S, Ctrl+N, etc. | [Source](../../{sourcePath}) |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 3. Business Flow Description
|
|
100
|
+
|
|
101
|
+
<!-- AI-TAG: BUSINESS_FLOW -->
|
|
102
|
+
<!-- AI-NOTE: Desktop events: Click, DoubleClick, SelectedIndexChanged, TextChanged -->
|
|
103
|
+
|
|
104
|
+
### 3.1 Window Initialization Flow
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
graph TB
|
|
108
|
+
Start([Window Load]) --> Init[Initialize Components]
|
|
109
|
+
Init --> LoadConfig[Load Configuration]
|
|
110
|
+
LoadConfig --> CheckAuth{Check Auth}
|
|
111
|
+
CheckAuth -->|Not Auth| Login[Show Login Dialog]
|
|
112
|
+
CheckAuth -->|Authed| LoadData[Load Initial Data]
|
|
113
|
+
Login --> LoadData
|
|
114
|
+
LoadData --> BindData[Bind to Controls]
|
|
115
|
+
BindData --> End([End])
|
|
116
|
+
|
|
117
|
+
LoadData -->|Call| Service1[Service.GetData]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Flow Description:**
|
|
121
|
+
|
|
122
|
+
| Step | Business Operation | Event | Source |
|
|
123
|
+
|------|-------------------|-------|--------|
|
|
124
|
+
| 1 | Initialize UI components | Form_Load/OnInitialized | [Source](../../{sourcePath}) |
|
|
125
|
+
| 2 | Load app configuration | After init | [Source](../../{sourcePath}) |
|
|
126
|
+
| 3 | Check authentication | After config load | [Source](../../{sourcePath}) |
|
|
127
|
+
| 4 | Load data from service | Auth passed | [Source](../../{sourcePath}) |
|
|
128
|
+
| 5 | Bind data to controls | Data loaded | [Source](../../{sourcePath}) |
|
|
129
|
+
|
|
130
|
+
### 3.2 User Interaction Flows
|
|
131
|
+
|
|
132
|
+
#### 3.2.1 {Event Name: e.g., Grid Row DoubleClick}
|
|
133
|
+
|
|
134
|
+
```mermaid
|
|
135
|
+
graph TB
|
|
136
|
+
DblClick[Row DoubleClick] --> GetRow[Get Selected Row]
|
|
137
|
+
GetRow --> Validate{Valid Selection}
|
|
138
|
+
Validate -->|Valid| OpenDialog[Open Edit Dialog]
|
|
139
|
+
Validate -->|Invalid| ShowError[Show Error]
|
|
140
|
+
OpenDialog --> LoadDetail[Load Detail Data]
|
|
141
|
+
LoadDetail --> ShowModal[Show Dialog Modal]
|
|
142
|
+
ShowModal --> WaitResult[Wait for Result]
|
|
143
|
+
WaitResult -->|Save| SaveData[Save Changes]
|
|
144
|
+
WaitResult -->|Cancel| CloseDialog[Close Dialog]
|
|
145
|
+
|
|
146
|
+
LoadDetail -->|Call| Service2[Service.GetDetail]
|
|
147
|
+
SaveData -->|Call| Service3[Service.Save]
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Flow Description:**
|
|
151
|
+
|
|
152
|
+
| Step | Business Operation | Event | Source |
|
|
153
|
+
|------|-------------------|-------|--------|
|
|
154
|
+
| 1 | Get selected row | DoubleClick | [Source](../../{sourcePath}) |
|
|
155
|
+
| 2 | Validate selection | After get | [Source](../../{sourcePath}) |
|
|
156
|
+
| 3 | Open edit dialog | Validation passed | [Source](../../{sourcePath}) |
|
|
157
|
+
| 4 | Load detail data | Dialog opened | [Source](../../{sourcePath}) |
|
|
158
|
+
| 5 | Handle save/cancel | Dialog closed | [Source](../../{sourcePath}) |
|
|
159
|
+
|
|
160
|
+
#### 3.2.2 {Event Name: e.g., Toolbar Button Click}
|
|
161
|
+
|
|
162
|
+
```mermaid
|
|
163
|
+
graph TB
|
|
164
|
+
Click[Button Click] --> CheckType{Button Type}
|
|
165
|
+
CheckType -->|New| NewDialog[Open New Dialog]
|
|
166
|
+
CheckType -->|Delete| Confirm[Confirm Delete]
|
|
167
|
+
CheckType -->|Refresh| Reload[Reload Data]
|
|
168
|
+
Confirm -->|Yes| DeleteData[Delete Record]
|
|
169
|
+
Confirm -->|No| Cancel[Cancel]
|
|
170
|
+
|
|
171
|
+
DeleteData -->|Call| Service4[Service.Delete]
|
|
172
|
+
Reload -->|Call| Service5[Service.GetData]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 3.3 Window Lifecycle
|
|
176
|
+
|
|
177
|
+
```mermaid
|
|
178
|
+
graph TB
|
|
179
|
+
subgraph WindowLifecycle["Window/Form Lifecycle"]
|
|
180
|
+
Load[Form.Load/Initialized] --> Shown[Form.Shown/Loaded]
|
|
181
|
+
Shown --> Activated[Form.Activated]
|
|
182
|
+
Activated --> Deactivated[Form.Deactivated]
|
|
183
|
+
Deactivated --> Activated
|
|
184
|
+
Deactivated --> Closing[Form.Closing]
|
|
185
|
+
Closing --> Closed[Form.Closed/Unloaded]
|
|
186
|
+
end
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Lifecycle Events:**
|
|
190
|
+
|
|
191
|
+
| Event | WPF | WinForms | Purpose | Source |
|
|
192
|
+
|-------|-----|----------|---------|--------|
|
|
193
|
+
| Initialized | ✅ | - | Component init | [Source](../../{sourcePath}) |
|
|
194
|
+
| Loaded | ✅ | Load | Window loaded | [Source](../../{sourcePath}) |
|
|
195
|
+
| Shown | - | Shown | Window visible | [Source](../../{sourcePath}) |
|
|
196
|
+
| Activated | ✅ | Activated | Window focused | [Source](../../{sourcePath}) |
|
|
197
|
+
| Closing | ✅ | FormClosing | About to close | [Source](../../{sourcePath}) |
|
|
198
|
+
| Closed | ✅ | FormClosed | Window closed | [Source](../../{sourcePath}) |
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 4. Data Field Definition
|
|
203
|
+
|
|
204
|
+
### 4.1 Window State Fields
|
|
205
|
+
|
|
206
|
+
| Field Name | Type | Description | Binding | Source |
|
|
207
|
+
|------------|------|-------------|---------|--------|
|
|
208
|
+
| {Field 1} | string/int/bool | {Description} | {OneWay/TwoWay} | [Source](../../{sourcePath}) |
|
|
209
|
+
| {SelectedItem} | Object | {Current selection} | {OneWayToSource} | [Source](../../{sourcePath}) |
|
|
210
|
+
| {DataSource} | Collection | {List data} | {OneWay} | [Source](../../{sourcePath}) |
|
|
211
|
+
| {IsBusy} | bool | {Loading state} | {OneWay} | [Source](../../{sourcePath}) |
|
|
212
|
+
|
|
213
|
+
### 4.2 Form Fields (if applicable)
|
|
214
|
+
|
|
215
|
+
| Field Name | Type | Validation | Control | Source |
|
|
216
|
+
|------------|------|------------|---------|--------|
|
|
217
|
+
| {Field 1} | string | {Required} | TextBox | [Source](../../{sourcePath}) |
|
|
218
|
+
| {Field 2} | int | {Range} | NumericUpDown | [Source](../../{sourcePath}) |
|
|
219
|
+
| {Field 3} | DateTime | {Not null} | DateTimePicker | [Source](../../{sourcePath}) |
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 5. References
|
|
224
|
+
|
|
225
|
+
### 5.1 Services
|
|
226
|
+
|
|
227
|
+
| Service | Type | Main Function | Source | Document Path |
|
|
228
|
+
|---------|------|---------------|--------|---------------|
|
|
229
|
+
| {Service Name} | Business | {Description} | [Source](../../{serviceSourcePath}) | [Service Doc](../../services/{service-name}.md) |
|
|
230
|
+
|
|
231
|
+
### 5.2 UI Components
|
|
232
|
+
|
|
233
|
+
| Component | Framework | Type | Main Function | Source | Document Path |
|
|
234
|
+
|-----------|-----------|------|---------------|--------|---------------|
|
|
235
|
+
| {UserControl} | WPF/WinForms | Custom | {Reusable UI} | [Source](../../{componentSourcePath}) | [Component Doc](../../components/{component-name}.md) |
|
|
236
|
+
|
|
237
|
+
### 5.3 Other Windows
|
|
238
|
+
|
|
239
|
+
| Window Name | Relation Type | Description | Source | Document Path |
|
|
240
|
+
|-------------|---------------|-------------|--------|---------------|
|
|
241
|
+
| {Window Name} | Dialog/Child | {Relation description} | [Source](../../{windowSourcePath}) | [Window Doc](../{window-path}.md) |
|
|
242
|
+
|
|
243
|
+
### 5.4 Referenced By
|
|
244
|
+
|
|
245
|
+
| Window Name | Function Description | Source Path | Document Path |
|
|
246
|
+
|-------------|---------------------|-------------|---------------|
|
|
247
|
+
| {Referencing Window} | {e.g., "Open this window from main menu"} | {source-path} | [Window Doc](../{window-path}.md) |
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## 6. Business Rule Constraints
|
|
252
|
+
|
|
253
|
+
### 6.1 Permission Rules
|
|
254
|
+
|
|
255
|
+
| Operation | Permission Requirement | No Permission Handling | Source |
|
|
256
|
+
|-----------|----------------------|----------------------|--------|
|
|
257
|
+
| View window | {Role required} | Hide menu item / Show message | [Source](../../{sourcePath}) |
|
|
258
|
+
| Edit data | {Permission required} | Disable edit button | [Source](../../{sourcePath}) |
|
|
259
|
+
| Delete record | {Admin role} | Disable delete button | [Source](../../{sourcePath}) |
|
|
260
|
+
|
|
261
|
+
### 6.2 Desktop-Specific Rules
|
|
262
|
+
|
|
263
|
+
1. **Auto-save**: {e.g., Auto-save draft every 5 minutes} | [Source](../../{sourcePath})
|
|
264
|
+
2. **Keyboard Shortcuts**: {e.g., Ctrl+S save, Ctrl+F find} | [Source](../../{sourcePath})
|
|
265
|
+
3. **Window State**: {e.g., Remember window size and position} | [Source](../../{sourcePath})
|
|
266
|
+
|
|
267
|
+
### 6.3 Validation Rules
|
|
268
|
+
|
|
269
|
+
| Scenario | Rule | Error Handling | Source |
|
|
270
|
+
|----------|------|----------------|--------|
|
|
271
|
+
| Form submit | {Validation rule} | Show error provider / MessageBox | [Source](../../{sourcePath}) |
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## 7. Notes and Additional Information
|
|
276
|
+
|
|
277
|
+
### 7.1 Platform Adaptation
|
|
278
|
+
|
|
279
|
+
- **WinForms**: Traditional Windows desktop, simple data binding
|
|
280
|
+
- **WPF**: Modern UI, XAML, MVVM pattern, powerful data binding
|
|
281
|
+
- **WinUI 3**: Latest Windows UI, Fluent Design, modern controls
|
|
282
|
+
|
|
283
|
+
### 7.2 Performance Considerations
|
|
284
|
+
|
|
285
|
+
- **Large Data**: Use virtualization for large lists
|
|
286
|
+
- **Async Operations**: Use async/await for I/O operations
|
|
287
|
+
- **UI Freezing**: Use BackgroundWorker or async for long operations
|
|
288
|
+
|
|
289
|
+
### 7.3 Pending Confirmations
|
|
290
|
+
|
|
291
|
+
- [ ] **{Pending 1}**: {e.g., Whether to support dark theme}
|
|
292
|
+
- [ ] **{Pending 2}**: {e.g., Whether to add print functionality}
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
**Document Status:** 📝 Draft / 👀 In Review / ✅ Published
|
|
297
|
+
**Last Updated:** {Date}
|
|
298
|
+
**Maintainer:** {Name}
|
|
299
|
+
**Related Module Document:** [Module Overview Document](../{{module-name}}-overview.md)
|
|
300
|
+
|
|
301
|
+
**Section Source**
|
|
302
|
+
- [{Window}.xaml.cs/{Form}.cs](../../{sourcePath})
|
|
303
|
+
- [{ViewModel}.cs](../../{viewModelPath})
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
|
|
2
|
+
# Feature Detail Design Template - [Feature Name]
|
|
3
|
+
|
|
4
|
+
> **Platform**: Desktop Application (Electron)
|
|
5
|
+
> **Tech Stack**: HTML/CSS/JavaScript + Electron APIs + Node.js
|
|
6
|
+
|
|
7
|
+
## 1. Content Overview
|
|
8
|
+
|
|
9
|
+
name: {Feature Name}
|
|
10
|
+
|
|
11
|
+
description: Feature overview.
|
|
12
|
+
|
|
13
|
+
document-path: {documentPath}
|
|
14
|
+
source-path: {sourcePath}
|
|
15
|
+
|
|
16
|
+
## 2. Interface Prototype
|
|
17
|
+
|
|
18
|
+
<!-- AI-TAG: UI_PROTOTYPE -->
|
|
19
|
+
<!-- AI-NOTE: Electron UI uses web-based ASCII wireframes -->
|
|
20
|
+
<!-- AI-NOTE: Window can be frameless or with native frame -->
|
|
21
|
+
<!-- AI-NOTE: ONLY draw prototype for the MAIN RENDERER PROCESS defined in {{sourcePath}} -->
|
|
22
|
+
|
|
23
|
+
### 2.1 {Main Window Name}
|
|
24
|
+
|
|
25
|
+
**Frameless Window with Custom Title Bar:**
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
29
|
+
│ ● ● ● [App Title] ─ □ ✕ │ ← Custom Title Bar
|
|
30
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
31
|
+
│ ┌──────────┬──────────────────────────────────────────────────────┐ │
|
|
32
|
+
│ │ │ ≡ Menu [New] [Open] [Save] 🔍 Search... [⚙] │ │ ← Toolbar
|
|
33
|
+
│ │ ├──────────────────────────────────────────────────────┤ │
|
|
34
|
+
│ │ │ 📁 Home / 📂 Project / 📄 Current File │ │ ← Breadcrumb
|
|
35
|
+
│ │ ├──────────────────────────────────────────────────────┤ │
|
|
36
|
+
│ │ Sidebar │ │ │
|
|
37
|
+
│ │ ┌────┐ │ ┌────────────────────────────────────────────────┐ │ │
|
|
38
|
+
│ │ │ 📁 │ │ │ Content Area │ │ │
|
|
39
|
+
│ │ │ 📄 │ │ │ │ │ │
|
|
40
|
+
│ │ │ 🖼 │ │ │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ │ │
|
|
41
|
+
│ │ │ ⚙ │ │ │ │ Card 1 │ │ Card 2 │ │ Card 3 │ │ │ │
|
|
42
|
+
│ │ └────┘ │ │ └─────────┘ └─────────┘ └─────────┘ │ │ │
|
|
43
|
+
│ │ │ │ │ │ │
|
|
44
|
+
│ │ │ │ ┌────────────────────────────────────────┐ │ │ │
|
|
45
|
+
│ │ │ │ │ Data Table │ │ │ │
|
|
46
|
+
│ │ │ │ │ ┌────┬────────┬────────┬────────┐ │ │ │ │
|
|
47
|
+
│ │ │ │ │ │ ID │ Name │ Status │ Action │ │ │ │ │
|
|
48
|
+
│ │ │ │ │ ├────┼────────┼────────┼────────┤ │ │ │ │
|
|
49
|
+
│ │ │ │ │ │ 1 │ Item 1 │ Active │ [Edit] │ │ │ │ │
|
|
50
|
+
│ │ │ │ │ │ 2 │ Item 2 │ Draft │ [Edit] │ │ │ │ │
|
|
51
|
+
│ │ │ │ │ └────┴────────┴────────┴────────┘ │ │ │ │
|
|
52
|
+
│ │ │ │ └────────────────────────────────────────┘ │ │ │
|
|
53
|
+
│ └──────────┴──────────────────────────────────────────────────────┘ │
|
|
54
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
55
|
+
│ [Status] Ready | [Sync] ✓ | [User] John Doe [⚡] [🔔] │ ← Status Bar
|
|
56
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**With Native Frame:**
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
63
|
+
│ [App Title] ─ □ ✕ │
|
|
64
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
65
|
+
│ File Edit View Window Help │ ← Native Menu
|
|
66
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
67
|
+
│ [Toolbar content same as above] │
|
|
68
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Interface Element Description:**
|
|
72
|
+
|
|
73
|
+
| Area | Element | Type | Description | Interaction | Source Link |
|
|
74
|
+
|------|---------|------|-------------|-------------|-------------|
|
|
75
|
+
| Title Bar | Window Controls | Button | {Minimize/Maximize/Close} | Click | [Source](../../{sourcePath}) |
|
|
76
|
+
| Menu | App Menu | Menu | {Application menu} | Click | [Source](../../{sourcePath}) |
|
|
77
|
+
| Toolbar | Action Buttons | Button | {Primary actions} | Click | [Source](../../{sourcePath}) |
|
|
78
|
+
| Sidebar | Navigation | Nav | {Section navigation} | Click | [Source](../../{sourcePath}) |
|
|
79
|
+
| Content | Cards/Tables | Component | {Display content} | Click/Right-click | [Source](../../{sourcePath}) |
|
|
80
|
+
| Status Bar | Status Info | Status | {App status} | - | [Source](../../{sourcePath}) |
|
|
81
|
+
|
|
82
|
+
**Electron-Specific Interactions:**
|
|
83
|
+
|
|
84
|
+
| Interaction | Action | Description | Source |
|
|
85
|
+
|-------------|--------|-------------|--------|
|
|
86
|
+
| Click | Select/Activate | Mouse click | [Source](../../{sourcePath}) |
|
|
87
|
+
| RightClick | Context Menu | Show native/context menu | [Source](../../{sourcePath}) |
|
|
88
|
+
| Drag | File Drop | Drag files into window | [Source](../../{sourcePath}) |
|
|
89
|
+
| Keyboard | Shortcut | Cmd/Ctrl+ shortcuts | [Source](../../{sourcePath}) |
|
|
90
|
+
| IPC | Main ↔ Renderer | Communication between processes | [Source](../../{sourcePath}) |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 3. Business Flow Description
|
|
95
|
+
|
|
96
|
+
<!-- AI-TAG: BUSINESS_FLOW -->
|
|
97
|
+
<!-- AI-NOTE: Electron has Main Process and Renderer Process -->
|
|
98
|
+
<!-- AI-NOTE: Events: DOM events + Electron IPC events -->
|
|
99
|
+
|
|
100
|
+
### 3.1 Window Initialization Flow
|
|
101
|
+
|
|
102
|
+
```mermaid
|
|
103
|
+
graph TB
|
|
104
|
+
Start([App Start]) --> Main[Main Process Start]
|
|
105
|
+
Main --> CreateWindow[Create BrowserWindow]
|
|
106
|
+
CreateWindow --> LoadURL[Load Renderer URL]
|
|
107
|
+
LoadURL --> Renderer[Renderer Process Load]
|
|
108
|
+
Renderer --> Init[Initialize React/Vue/Angular]
|
|
109
|
+
Init --> CheckUpdate{Check Update}
|
|
110
|
+
CheckUpdate -->|Update Available| ShowUpdate[Show Update Dialog]
|
|
111
|
+
CheckUpdate -->|No Update| LoadData[Load User Data]
|
|
112
|
+
ShowUpdate --> LoadData
|
|
113
|
+
LoadData --> RenderUI[Render UI]
|
|
114
|
+
RenderUI --> End([End])
|
|
115
|
+
|
|
116
|
+
LoadData -->|IPC| IPC1[ipcRenderer.invoke - Get data]
|
|
117
|
+
IPC1 -->|Main| IPC2[ipcMain.handle - Read file/DB]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Flow Description:**
|
|
121
|
+
|
|
122
|
+
| Step | Business Operation | Process | Source |
|
|
123
|
+
|------|-------------------|---------|--------|
|
|
124
|
+
| 1 | Main process starts | Main | [Source](../../{mainSourcePath}) |
|
|
125
|
+
| 2 | Create browser window | Main | [Source](../../{mainSourcePath}) |
|
|
126
|
+
| 3 | Renderer process loads | Renderer | [Source](../../{sourcePath}) |
|
|
127
|
+
| 4 | Initialize frontend framework | Renderer | [Source](../../{sourcePath}) |
|
|
128
|
+
| 5 | Check for updates | Main → Renderer | [Source](../../{sourcePath}) |
|
|
129
|
+
| 6 | Load user data via IPC | Renderer → Main | [Source](../../{sourcePath}) |
|
|
130
|
+
|
|
131
|
+
### 3.2 User Interaction Flows
|
|
132
|
+
|
|
133
|
+
#### 3.2.1 {Event Name: e.g., Save File}
|
|
134
|
+
|
|
135
|
+
```mermaid
|
|
136
|
+
graph TB
|
|
137
|
+
Click[Click Save] --> Validate[Validate Data]
|
|
138
|
+
Validate -->|Valid| IPC_Send[ipcRenderer.invoke]
|
|
139
|
+
Validate -->|Invalid| ShowError[Show Validation Error]
|
|
140
|
+
IPC_Send --> IPC_Receive[ipcMain.handle]
|
|
141
|
+
IPC_Receive --> ShowDialog[Show Save Dialog]
|
|
142
|
+
ShowDialog --> UserSelect[User Select Path]
|
|
143
|
+
UserSelect --> WriteFile[Write to File]
|
|
144
|
+
WriteFile --> SendResult[Send Result via IPC]
|
|
145
|
+
SendResult --> UpdateUI[Update UI Status]
|
|
146
|
+
|
|
147
|
+
ShowDialog -->|Electron| DialogAPI[dialog.showSaveDialog]
|
|
148
|
+
WriteFile -->|Node.js| FS[fs.writeFile]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Flow Description:**
|
|
152
|
+
|
|
153
|
+
| Step | Business Operation | Process | Source |
|
|
154
|
+
|------|-------------------|---------|--------|
|
|
155
|
+
| 1 | Validate form data | Renderer | [Source](../../{sourcePath}) |
|
|
156
|
+
| 2 | Send IPC message | Renderer | [Source](../../{sourcePath}) |
|
|
157
|
+
| 3 | Handle IPC call | Main | [Source](../../{mainSourcePath}) |
|
|
158
|
+
| 4 | Show native dialog | Main | [Source](../../{mainSourcePath}) |
|
|
159
|
+
| 5 | Write file | Main | [Source](../../{mainSourcePath}) |
|
|
160
|
+
| 6 | Return result | Main → Renderer | [Source](../../{sourcePath}) |
|
|
161
|
+
|
|
162
|
+
#### 3.2.2 {Event Name: e.g., File Drop}
|
|
163
|
+
|
|
164
|
+
```mermaid
|
|
165
|
+
graph TB
|
|
166
|
+
Drop[Drop Files] --> Prevent[Prevent Default]
|
|
167
|
+
Prevent --> GetPaths[Get File Paths]
|
|
168
|
+
GetPaths --> Validate{Validate Files}
|
|
169
|
+
Validate -->|Valid| ProcessFiles[Process Files]
|
|
170
|
+
Validate -->|Invalid| ShowError[Show Error]
|
|
171
|
+
ProcessFiles --> ReadContent[Read File Content]
|
|
172
|
+
ReadContent --> UpdateState[Update App State]
|
|
173
|
+
UpdateState --> Render[Re-render UI]
|
|
174
|
+
|
|
175
|
+
ReadContent -->|IPC| IPC3[Read via main process]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 3.3 IPC Communication Patterns
|
|
179
|
+
|
|
180
|
+
```mermaid
|
|
181
|
+
graph TB
|
|
182
|
+
subgraph Renderer["Renderer Process (UI)"]
|
|
183
|
+
R1[ipcRenderer.send]
|
|
184
|
+
R2[ipcRenderer.invoke]
|
|
185
|
+
R3[ipcRenderer.on]
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
subgraph Main["Main Process (Node.js)"]
|
|
189
|
+
M1[ipcMain.on]
|
|
190
|
+
M2[ipcMain.handle]
|
|
191
|
+
M3[win.webContents.send]
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
R1 -->|Async| M1
|
|
195
|
+
R2 -->|Invoke/Handle| M2
|
|
196
|
+
M3 -->|Push| R3
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**IPC Methods:**
|
|
200
|
+
|
|
201
|
+
| Direction | Method | Use Case | Source |
|
|
202
|
+
|-----------|--------|----------|--------|
|
|
203
|
+
| Renderer → Main | ipcRenderer.send | Fire-and-forget | [Source](../../{sourcePath}) |
|
|
204
|
+
| Renderer → Main | ipcRenderer.invoke | Request/Response | [Source](../../{sourcePath}) |
|
|
205
|
+
| Main → Renderer | webContents.send | Push notification | [Source](../../{mainSourcePath}) |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## 4. Data Field Definition
|
|
210
|
+
|
|
211
|
+
### 4.1 Component State Fields
|
|
212
|
+
|
|
213
|
+
| Field Name | Type | Description | Framework | Source |
|
|
214
|
+
|------------|------|-------------|-----------|--------|
|
|
215
|
+
| {Field 1} | string/number/boolean | {Description} | React/Vue/Angular | [Source](../../{sourcePath}) |
|
|
216
|
+
| {files} | Array | {Dropped files} | React/Vue/Angular | [Source](../../{sourcePath}) |
|
|
217
|
+
| {isProcessing} | boolean | {Processing state} | React/Vue/Angular | [Source](../../{sourcePath}) |
|
|
218
|
+
| {settings} | Object | {App settings} | React/Vue/Angular | [Source](../../{sourcePath}) |
|
|
219
|
+
|
|
220
|
+
### 4.2 Form Fields (if applicable)
|
|
221
|
+
|
|
222
|
+
| Field Name | Type | Validation | Component | Source |
|
|
223
|
+
|------------|------|------------|-----------|--------|
|
|
224
|
+
| {Field 1} | string | {Required} | Input | [Source](../../{sourcePath}) |
|
|
225
|
+
| {Field 2} | string | {File path} | Input + File picker | [Source](../../{sourcePath}) |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## 5. References
|
|
230
|
+
|
|
231
|
+
### 5.1 Main Process APIs
|
|
232
|
+
|
|
233
|
+
| API | Module | Purpose | Source | Document Path |
|
|
234
|
+
|-----|--------|---------|--------|---------------|
|
|
235
|
+
| {Handler Name} | ipcMain | {IPC handler description} | [Source](../../{mainSourcePath}) | [Main Doc](../../main/{handler-name}.md) |
|
|
236
|
+
|
|
237
|
+
### 5.2 Electron APIs
|
|
238
|
+
|
|
239
|
+
| API | Process | Purpose | Usage | Source |
|
|
240
|
+
|-----|---------|---------|-------|--------|
|
|
241
|
+
| dialog | Main | Native dialogs | Open/Save dialogs | [Source](../../{mainSourcePath}) |
|
|
242
|
+
| shell | Both | Open external | Open file manager/browser | [Source](../../{sourcePath}) |
|
|
243
|
+
| clipboard | Renderer | Clipboard ops | Copy/paste | [Source](../../{sourcePath}) |
|
|
244
|
+
| notification | Renderer | Native notifications | Show notification | [Source](../../{sourcePath}) |
|
|
245
|
+
|
|
246
|
+
### 5.3 Node.js Modules
|
|
247
|
+
|
|
248
|
+
| Module | Purpose | Usage | Source |
|
|
249
|
+
|--------|---------|-------|--------|
|
|
250
|
+
| fs | File system | Read/write files | [Source](../../{mainSourcePath}) |
|
|
251
|
+
| path | Path operations | Handle file paths | [Source](../../{mainSourcePath}) |
|
|
252
|
+
| os | System info | Get platform info | [Source](../../{mainSourcePath}) |
|
|
253
|
+
|
|
254
|
+
### 5.4 Other Windows
|
|
255
|
+
|
|
256
|
+
| Window Name | Relation Type | Description | Source | Document Path |
|
|
257
|
+
|-------------|---------------|-------------|--------|---------------|
|
|
258
|
+
| {Window Name} | Modal/Child | {Relation description} | [Source](../../{windowSourcePath}) | [Window Doc](../{window-path}.md) |
|
|
259
|
+
|
|
260
|
+
### 5.5 Referenced By
|
|
261
|
+
|
|
262
|
+
| Window Name | Function Description | Source Path | Document Path |
|
|
263
|
+
|-------------|---------------------|-------------|---------------|
|
|
264
|
+
| {Referencing Window} | {e.g., "Open from main menu"} | {source-path} | [Window Doc](../{window-path}.md) |
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 6. Business Rule Constraints
|
|
269
|
+
|
|
270
|
+
### 6.1 Permission Rules
|
|
271
|
+
|
|
272
|
+
| Operation | Permission | No Permission Handling | Source |
|
|
273
|
+
|-----------|------------|----------------------|--------|
|
|
274
|
+
| File system access | {User consent} | Show permission dialog | [Source](../../{sourcePath}) |
|
|
275
|
+
| External links | {N/A} | Open in system browser | [Source](../../{sourcePath}) |
|
|
276
|
+
|
|
277
|
+
### 6.2 Electron-Specific Rules
|
|
278
|
+
|
|
279
|
+
1. **Security**: {e.g., Enable contextIsolation, use IPC not remote} | [Source](../../{sourcePath})
|
|
280
|
+
2. **Auto-update**: {e.g., Check updates on startup} | [Source](../../{sourcePath})
|
|
281
|
+
3. **Window State**: {e.g., Restore window position/size} | [Source](../../{sourcePath})
|
|
282
|
+
|
|
283
|
+
### 6.3 Validation Rules
|
|
284
|
+
|
|
285
|
+
| Scenario | Rule | Error Handling | Source |
|
|
286
|
+
|----------|------|----------------|--------|
|
|
287
|
+
| File type | {Allowed extensions} | Show error dialog | [Source](../../{sourcePath}) |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 7. Notes and Additional Information
|
|
292
|
+
|
|
293
|
+
### 7.1 Process Architecture
|
|
294
|
+
|
|
295
|
+
- **Main Process**: Node.js environment, system access, window management
|
|
296
|
+
- **Renderer Process**: Chromium environment, UI rendering, limited system access
|
|
297
|
+
- **Preload Script**: Bridge between Main and Renderer for secure IPC
|
|
298
|
+
|
|
299
|
+
### 7.2 Security Best Practices
|
|
300
|
+
|
|
301
|
+
- Enable `contextIsolation` and `sandbox`
|
|
302
|
+
- Use `preload.js` for IPC exposure
|
|
303
|
+
- Don't enable `nodeIntegration` in renderer
|
|
304
|
+
- Validate all IPC inputs
|
|
305
|
+
|
|
306
|
+
### 7.3 Platform Considerations
|
|
307
|
+
|
|
308
|
+
- **Windows**: Use native menus, support Windows notifications
|
|
309
|
+
- **macOS**: Follow HIG, support TouchBar, native menus
|
|
310
|
+
- **Linux**: Test on major distributions
|
|
311
|
+
|
|
312
|
+
### 7.4 Pending Confirmations
|
|
313
|
+
|
|
314
|
+
- [ ] **{Pending 1}**: {e.g., Whether to support auto-updater}
|
|
315
|
+
- [ ] **{Pending 2}**: {e.g., Whether to add system tray integration}
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
**Document Status:** 📝 Draft / 👀 In Review / ✅ Published
|
|
320
|
+
**Last Updated:** {Date}
|
|
321
|
+
**Maintainer:** {Name}
|
|
322
|
+
**Related Module Document:** [Module Overview Document](../{{module-name}}-overview.md)
|
|
323
|
+
|
|
324
|
+
**Section Source**
|
|
325
|
+
- [{Component}.jsx/.vue](../../{sourcePath})
|
|
326
|
+
- [main.js/main.ts](../../{mainSourcePath})
|
|
327
|
+
- [preload.js](../../{preloadSourcePath})
|