bito-code-review[bot] commented on PR #35817:
URL: https://github.com/apache/superset/pull/35817#issuecomment-3436399228
<details open>
<summary><strong>Interaction Diagram by <a
href="https://bito.ai#sequence_diagram">Bito</a></strong></summary>
```mermaid
sequenceDiagram
participant USER as User
participant HDR as Dashboard Header<br/>🔄 Updated | ●●○ Medium
participant REF as previousThemeRef<br/>🟩 Added | ●○○ Low
participant EFFECT as useEffect Hook<br/>🔄 Updated | ●●○ Medium
participant ACT as boundActionCreators
participant STORE as Redux Store
participant STATE as dashboardState Reducer
Note over HDR, REF: Theme tracking enhancement<br/>prevents false positives
USER->>HDR: Navigate to dashboard
HDR->>REF: Initialize with dashboardInfo.theme
HDR->>EFFECT: Monitor theme & editMode changes
EFFECT->>REF: Compare current vs previous theme
alt Edit Mode & Theme Changed
EFFECT->>ACT: setUnsavedChanges(true)
ACT->>STORE: Dispatch SET_UNSAVED_CHANGES
STORE->>STATE: Update hasUnsavedChanges
EFFECT->>REF: Update previousThemeRef
else Not Edit Mode
EFFECT->>REF: Sync previousThemeRef
end
USER->>HDR: Click Edit Dashboard button
HDR->>ACT: setUnsavedChanges(false)
ACT->>STORE: Reset unsaved changes flag
```
Critical path: User->Dashboard Header->useEffect
Hook->boundActionCreators->Redux Store
> **Note:** The Header component now uses a ref to track previous theme
values, preventing false positive unsaved change notifications when navigating
between dashboards. The edit button click also explicitly resets the unsaved
changes flag to ensure clean state initialization.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]