feat(reflow): add in-memory history tracking for Flow edits#4984
Open
abdelaziz-mahdy wants to merge 2 commits intodevelopmentfrom
Open
feat(reflow): add in-memory history tracking for Flow edits#4984abdelaziz-mahdy wants to merge 2 commits intodevelopmentfrom
abdelaziz-mahdy wants to merge 2 commits intodevelopmentfrom
Conversation
Wrap HistoryDAO inside the flow journal so journal replay on startup rebuilds per-edit history records. Add FlowHistoryView to render the history as expandable accordion rows with colour-coded old/new diffs and clipboard copy per value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reflow flows have no visible change history. Once a flow is saved, prior versions and property-level diffs are lost from the UI — reviewers can't see who edited a flow, when, or what fields changed.
Solution
Wrap
HistoryDAOinside the flow journal soJDAOreplay passes each persisted put through history on startup. Store history records in an in-memoryMDAOkeyed by aSequenceNumberDAOso the composite id (objectId,seqNo) stays unique across multiple edits of the same flow. Expose the history per flow via a transientDAOPropertyand render it with a newFlowHistoryView.Because history lives in memory, it rebuilds from the flows journal on every boot — no separate history journal, no unbounded growth. Live edits after boot append normally.
Changes
services.jrl— addflowHistoryDAOCSpec (in-memoryMDAOwrapped inSequenceNumberDAO); rewireflowDAOto constructHistoryDAO(flowHistoryDAO, new MDAO(Flow))and pass it toEasyDAO.setMdao(...)soJDAOwraps around history rather than around the bare MDAO.Flow.js— addfoam.mlang.Expressionstoimplements, importflowHistoryDAO?, add ahistorySectionand a transienthistoryDAOPropertythat filtersflowHistoryDAObyobjectIdand orders byseqNodesc.FlowHistoryView.js— new view rendering each history record as a collapsible row: timestamp, user, summary of changed property names, and an expandable diff grid showingproperty | old | newwith semantic colour tokens. Mixes infoam.u2.util.ClipboardAccessand adds a hover copy button per value cell.pom.js— registerFlowHistoryView.