diff --git "a/docs/res/\347\265\202\344\272\206\343\202\267\343\203\274\343\202\261\343\203\263\343\202\271\345\233\263.md" "b/docs/res/\347\265\202\344\272\206\343\202\267\343\203\274\343\202\261\343\203\263\343\202\271\345\233\263.md" index 1a5c4e7759..f9bd64fcb1 100644 --- "a/docs/res/\347\265\202\344\272\206\343\202\267\343\203\274\343\202\261\343\203\263\343\202\271\345\233\263.md" +++ "b/docs/res/\347\265\202\344\272\206\343\202\267\343\203\274\343\202\261\343\203\263\343\202\271\345\233\263.md" @@ -2,60 +2,67 @@ ```mermaid flowchart TD - node_1>"アプリ実行中"] -.->|"MacのCmd+Q"| subgraph_2["app.before_quit"] - style node_1 fill:#ffbbbb,stroke:#ff0000 - node_21{{"winがclose済みか"}} -.->|"NO"| subgraph_1["win.close"] - node_1 -.->|"MacのCmd+W・WinのAlt+F4"| subgraph_1 - node_15["app.quit"] -.-> subgraph_2 - a{{"willQuit"}} -.->|"true"| subgraph_2 - node_21 -.->|"YES"| node_23>"アプリ終了"] - style node_23 fill:#bbbbff,stroke:#0000ff - 846215{" "} -->|"reload"| 186768["RELOAD_APP"] - node_1 -->|"×ボタン"| 295190(["close"]) - node_1 -->|"アプリを再読み込み"| 929152(["reload"]) - 846215 -->|"close"| 208965["back.CLOSE_WINDOW"] - node_9["event.preventDefault"] --> 295190 - 295190 --> 571782["Vuex.CHECK_EDITED_AND_NOT_SAVE"] - 929152 --> 571782 - 177756{{"alreadyCompleted?"}} -->|"true"| node_21 - 442878["event.preventDefault"] --> 295190 - node_8["win.destroy"] -.-> subgraph_2 - 705785[["cleanupEngines"]] ~~~ 793927["cleanupEngines"] - 198115["win.loadURL"] --> 562861>"UIの描画"] - 454139[["cleanupEngines"]] ~~~ 793927 - subgraph 186768["RELOAD_APP"] - 705785 --> 700765{{"alreadyCompleted?"}} - 700765 -->|"false"| 462289["await"] - 700765 -->|"true"| 464405[["launchEngines"]] - 462289 --> 464405 - 464405 --> 198115 - 494918["win.loadURL(dummy)"] --> 705785 - end - subgraph 208965["back.CLOSE_WINDOW"] - node_7(["willQuit=true"]) --> node_8 - end - subgraph 571782["Vuex.CHECK_EDITED_AND_NOT_SAVE"] - 846215 -->|"キャンセル"| node_6>"アプリ実行中に戻る"] - end - subgraph 793927["cleanupEngines"] - node_12["engine.killEngineAll"] --> 889691{{"numLivingEngineProcess"}} - 889691 -->|"0"| 916552{{"hasMarkedEngineDirs"}} - node_14["全エンジンkill待機"] --> node_18["vvpp.handleMarkedEngineDirs"] - 889691 -->|">0"| node_14 - 916552 -->|"false"| node_14 - 916552 -->|"true"| 655722["何もしない"] - end - subgraph subgraph_2["app.before_quit"] - c{{"willQuit"}} -->|"false"| node_9 - c -->|"true"| 454139 - 177756 -->|"false"| node_13["event.preventDefault"] - node_13 --> 322763["await"] - 322763 --> node_15 - 925653["configManager.ensureSaved"] --> 177756 - 454139 --> 177756 - c -->|"true"| 925653 - end - subgraph subgraph_1["win.close"] - a -->|"false"| 442878 - end + +RUNNING>"アプリ実行中"] +END>"アプリ終了"] + +style RUNNING fill:#ffbbbb,stroke:#ff0000 +style END fill:#bbbbff,stroke:#0000ff + +RUNNING -->|"× ボタン"| CLOSE_EVT["close"] +RUNNING -->|"アプリを再読み込み"| RELOAD_EVT["reload"] +RUNNING -.->|"Cmd+W / Alt+F4"| win_close +RUNNING -.->|"Cmd+Q"| app_before_quit + +CLOSE_EVT --> CHECK_EDIT["Vuex.CHECK_EDITED_AND_NOT_SAVE"] +RELOAD_EVT --> CHECK_EDIT + +CHECK_EDIT -->|"キャンセル"| RUNNING +CHECK_EDIT -->|"OK"| CLOSE_OR_RELOAD + +CLOSE_OR_RELOAD -->|"close"| back_CLOSE_WINDOW +CLOSE_OR_RELOAD -->|"reload"| RELOAD_APP_START + +win_close["win.close"] --> AppStateController_onQuitRequest + +subgraph back_CLOSE_WINDOW["back.CLOSE_WINDOW"] + call_shutdown["AppStateController.shutdown"] +end +call_shutdown --> AppStateController_onQuitRequest + +subgraph CLEANUP["cleanupEngines"] + KILL_ALL["engine.killEngineAll"] + KILL_ALL --> COUNT{{numLivingEngineProcess}} + + COUNT -->|" > 0 "| WAIT_KILL["全エンジン kill 待機"] + WAIT_KILL --> HANDLE_DIR["vvpp.handleMarkedEngineDirs"] + + COUNT -->|"0"| MARKED{{hasMarkedEngineDirs}} + MARKED -->|"false"| WAIT_KILL + MARKED -->|"true"| NOOP["何もしない"] +end + +RELOAD_APP_START --> LOAD_DUMMY["win.loadURL(dummy)"] +LOAD_DUMMY --> CLEANUP +CLEANUP --> COMPLETED{{alreadyCompleted?}} +COMPLETED -->|"false"| WAIT["await"] +WAIT --> LAUNCH +COMPLETED -->|"true"| LAUNCH +LAUNCH["launchEngines"] --> LOAD_UI["win.loadURL"] + +app_before_quit["app.before-quit"] --> AppStateController_onQuitRequest + +subgraph AppStateController_onQuitRequest["AppStateController.onQuitRequest"] + quitState["quitState"] + ensureSaved["ConfigManager.ensureSaved"] + appQuit["app.quit"] + + quitState -->|"unconfirmed"| preventQuit1["DI.preventQuit"] + quitState -->|"dirty"| preventQuit2["DI.preventQuit"] + preventQuit2 --> CLEANUP + CLEANUP --> ensureSaved + ensureSaved --> appQuit + + quitState -->|"done"| END +end ```