Conversation
Aller05
commented
Apr 14, 2024
- The muulti-tab function UI and interaction are very similar to vs code;
- Tab supports closing and switching;
- The tab will show the edited asterisk and whether it is locked;
- Double-click the tab name to modify the flow name;
- Adapted to various scenarios of adding new flows and opening flows, including:
- Click on the flow list,
- Added flow,
- Copy flow,
- Save as flow,
- Spotlight search to open flow,
- Open the specified version of flow

|
效果很好!就是如果tabs里面有dirty的,但是refresh的时候不会弹窗,会直接refresh了 |
ui/src/App.tsx
Outdated
| const saveCurWorkflow = useCallback(async () => { | ||
| if (curFlowID.current) { | ||
| const saveCurWorkflow = useCallback(async (id?: string) => { | ||
| const flowId = id || curFlowID.current; |
There was a problem hiding this comment.
我感觉可以用workflowsTable.curWorkflow.id, 以后curFlowID.current可以deprecate了
ui/src/App.tsx
Outdated
| setTimeout(() => { | ||
| loadWorkflowIDImpl(latestWfID!); | ||
| }, 200); |
There was a problem hiding this comment.
loadWorkflowIDImpl函数内会通过CustomEvent的方式通知MulitTab打开新的tab,刷新页面时,MulitTab组件的加载顺序在App之后,所以会出现MulitTab内的addEventListener还未注册上就dispatchEvent的情况。
|
"Load"或者drag workflow会覆盖当前的workflow |
Screen.Recording.2024-04-15.at.5.15.57.PM.mov刷新的时候topbar右半部分会稍微慢一点? |
奇怪。。我这里是正常的,我回头我录个屏给你看下,而且刷新的弹窗逻辑在App的handleBeforeUnload函数里,这次也没改动它 |
这个是上面那个加定时器的问题相关,我优化了下,去掉了定时器 |
| onDelete={async () => { | ||
| await workflowsTable?.batchDeleteFlow(selectedKeys); | ||
| batchOperationCallback("batchDelete"); | ||
| tabDataManager.batchDeleteTabData(selectedKeys); |
There was a problem hiding this comment.
你觉得这些 tabDataManager.batchDeleteTabData() 或者其他的 tabDataManager操作,是不是放到workflowsTable?.batchDeleteFlow()里面统一操作比较好呢,就不需要每个callsite都写一遍了
There was a problem hiding this comment.
嗯,可以的,不过tab更多的是打开、关闭、切换,纯tab触发,不涉及db操作,所以我只把flow的删除和修改名字的tab处理放到workflowsTable里了。
There was a problem hiding this comment.
》 不过tab更多的是打开、关闭、切换,纯tab触发,不涉及db操作,
确实 这个也有道理🤔
已修复 |



