Skip to content

Conversation

iitzIrFan
Copy link
Contributor

What changes are being made and why?

Solves: #11650

Original Problem: When you tried to view documentation while having unsaved changes in your flow, you would get an unwanted "unsaved changes" warning. This was happening because:

  1. The documentation panel interactions were being treated as flow-related changes
  2. The system couldn't distinguish between:
    - Actually modifying the flow content
    - Just viewing documentation about the flow's components

How the changes have been QAed?

  1. In MultiPanelFlowEditorView.vue:
    function isTabFlowRelated(element: Tab){ // Skip marking doc tab as dirty to avoid unsaved changes warning if (element.value === "doc") { return false; } return ["code", "nocode", "topology"].includes(element.value) || element.value.startsWith("nocode-") }

This prevents documentation tabs from affecting the flow's dirty state.

  1. In EditorWrapper.vue:

    let result = selectedElement ? getElementFromRange(selectedElement) : undefined; // Flag this as a documentation request result = {...result, hash: hash.value, forceRefresh: true, isDocumentationRequest: true}; pluginsStore.updateDocumentation(result);

Now explicitly flags documentation requests.

  1. In plugins.ts:

    async updateDocumentation(pluginElement?: ({ type: string, version?: string, forceRefresh?: boolean, isDocumentationRequest?: boolean } & Record<string, any>)) { // Special handling for documentation requests if (isDocumentationRequest && this.editorPlugin?.cls === type && !forceRefresh) { return; } // ... rest of the function }

Adds special handling for documentation requests.


To Verify the Fix: You can test the following scenarios:

  1. Make some changes to a flow but don't save

  2. Try to:

    • View documentation for different tasks
    • Switch between documentation and editor panels
    • Browse different sections of documentation
  3. You should NOT see any unsaved changes warnings

  4. However, if you try to navigate away from the flow editor with actual unsaved changes, you should still get the warning


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To review

Development

Successfully merging this pull request may close these issues.

1 participant