• Thomas Randolph's avatar
    Add `manuallyCollapsed` flag to Diff Files · d6c42a8b
    Thomas Randolph authored
    Of course, this means that there's a bunch of logic
    to coordinate the new flag with the original -
    `automaticallyCollapsed` - flag.
    
    In addition: the UI is updated to use the new flag
    whenever it's been set, but to continue to fall back
    to the old flag. This is primarily facilitated by a new
    helper utility for diff files to do the resolution in a
    single centralized place.
    
    Of note: the diff_file is updated to depend on the
    global store as the authoritative source of determining
    whether the file is collapsed or not. The previous
    version kept a local `isCollapsed` in sync with the
    global store, which introduced a huge amount of
    interwoven complexity. The update ingests the
    resolved collapsed state from the store when
    various observed properties update instead of
    inverting that flow.
    
    This is a full refactor of file collapsing.
    Because the previous version was a single flag, then
    modified with a user preference (file-by-file), there
    were some issues including a THIRD possible way
    that collapsing works. This update slightly simplifies
    how collapsing works by depending more heavily
    on the two flags stored in state and only modifying
    them with the user preference when necessary.
    d6c42a8b
diff_with_note.vue 4.48 KB