Skip to content

Commit

Permalink
Consolidate branch merging into Branch objects to maintain consiste…
Browse files Browse the repository at this point in the history
…nt `unmerged` status information (#1028)

* Generalize listening for all (instead of selected) rejected actions in listenerMiddleware

* Fixes for regex patterns to handle branch comparisons and entry formats in worktreeStatus command

* Throw console.error if file-only FSCache observes an unlinkDir event

* FSCache updates to track card UUIDs in 'reserved' instead of metafile UUIDs

* Update status of all modified sub-files when calling worktreeStatus in updateVersionedMetafile command

* Remove unnecessary imports

* Rebuild yarn.lock

* Resolve absolute paths based on repository root when filtering worktreeStatus entries in fileStatus command

* Observe updated metafile for each update step when listening to cardAdded or cardUpdated actions

* Translate 'uncommitted' branch status into '*modified' on directories for fileStatus command

* Combine 'revertStagedChanges' and 'revertUnmergedChanges' into a single 'revertChanges' async thunk for metafiles

* Fix newline parsing error in JSDoc block comments

* Convert namespace import to named imports for slices/metafiles

* Remove useEffect for hydrating child metafiles in Directory since listenerMiddleware already handles filebased and versioned updates

* Reset all unstaged, staged, and unmerged files using 'revertChanges' thunk in ResetButton

* Expand StyledTreeComponent to include a onHoverText for adding version status on hover of FileComponent in Explorer cards

* Filter by git status instead of conflicts array in selectByConflicted selector

* ConflictManagerReverse component for displaying UUID, Path, Update, Repo, Status, and Branch fields

* Updated listenerMiddleware for card additions/updates/removals that impact FSCache subscriptions

* Log action.meta fields in rejected async thunk actions observed by listenerMiddleware

* Populate branch field to align ConflictManager metafile types at creation and response callsites

* Filter conflicting metafiles by handler type instead of using isFilebasedMetafile since conflict metafiles might not be populated with a content field

* Metafile 'loading' field renamed to 'flags' and extracted into Flag type

* Transition to using the nullish coalescing operator (??) from TS 3.7

* GitStatus filters for staged/unstaged/conflicted consolidated into utils

* Branch motif colors expanded to indicate branches with merge conflicts

* Check branch status in updateBranch thunk

* Badge component to display number of conflicting chunks in Card components containing textual content

* Remove redundant check for unmerged conflict metafiles in updateVersionedMetafile since worktreeStatus is capable of detecting unmerged status

* Update metafile with new code content using nullish coalescing operator (??) from TS 3.7

* Remove redundant updateBranch call during merge since updateBranches now calls updateBranch internally

* Rename utils.isConflicted to isUnmerged to indicate that unmerged status differs from containing conflicting chunks

* Await updateBranches immediately upon Refresh button click event

* Extract regex patterns for conflicting chunks into utils.getConflictingChunks

* Check for conflicting chunks when determining if conflicted motif should be returned in getSourceMotif since status can change while chunks remain in content

* JSDoc @returns type for flattenArray and flattenObject

* symmetrical fn for partitioning two arrays into symmetrical differences and intersection subarrays

* updateVersionedMetafile thunk updates descendants for directory parameter metafiles

* selectByConflicted selector expanded to differentiate metafiles based on branches

* JSDoc @returns type for diff

* JSDoc @returns type for useMap

* JSDoc @returns type for usePrevious

* Newline after description in JSDoc block

* JSDoc @returns types and newlines after description blocks for immutables fns

* Newline after description in JSDoc blocks and adhering to jsdoc/multiline-blocks rule

* JSDoc @param and @returns types for createState and mockStore

* JSDoc comments clarified to indicate listeners that match on async thunk actions

* Fix listener updates for fulfilled Metafile async thunk update actions to use updated versions of underlying metafile

* Rename isUnstaged() to isModified() to more accurately reflect a modified, but not staged status

* Update conflicts field during onChange event in Editor

* Remove unused import withStyles

* All Button components updated to prevent propogating click events to parent components

* Refresh button component for updating filebased and versioned metafile fields

* BranchRibbon component responds to conflicts by changing text and background colors

* Add `electron-devtools-installer` package to devDependencies to auto install DevTool extensions into Electron

* Enable `redux-devtools` module in Electron app

* Remove unused module.exports.fallback imports

* Remove `plugin:import/electron` and use`settings.import/modules: ["electron"]` instead

* Standardized quotes in jest.config.js moduleNameMapper

* Updated ARCHITECTURE for changes to import packages and TS/ESLint/Jest/RTL configs

* ConflictManager card component removed, conflicts managed directly in Explorer card component

* Add `enabled` prop for enabling/disabling Button components during render

* Remove listener checks for deprecated `ConflictManager` metafile types

* Allow multiple astericks in JSDoc comments for Markdown bullet lists

* Fix overflowing card-header when title is long

* New Metadata component for a standardized table view of Metafile contents on the back of cards

* BranchList component simplified and migrated into Branches component tree

* BranchRibbon component simplified and migrated into Branches component tree

* JSDoc comments for Branches component

* BranchItem component allows highlights for indicating the current branch of a parent card, metafile, or list

* BranchesView button component for selecting Branches view on the back of cards

* Migrating Card components to use Metadata component on reverse

* Editor code content switched to pass-through from Metafile content property

* Updated ref to BranchRibbon component

* Updated jsdoc/no-multi-astericks rule format

* removeObjectProperty function added for immutably removing properties in a typesafe manner

* worktreeStatus checks for in-progress merges and returns 'unmerged' if found

* Branch objects expanded to include merging field when a branch is the base of an in-progress merge

* Metafile object no longer differentiates merging status, only conflict status (Branch objects handle merging now)

* BranchRibbon indicates unmerged based on branch.status instead of conflicted metafile count

* Abort button enable via checks against merging branches instead of merging metafiles

* Resolve button simplified to key off of merging branches in Explorer metafiles

* Stage button checks for unstaged metafiles based on unmerged status instead of modified status

* Remove unused isAbortable import

* Metadata component checks for merging branches instead of merging metafiles

* MergeDialog modal component checks for merging branches and updates accordingly

* fetchMergingBranches checks for the existence of MERGE_MSG file before attempting to read

* Remove unused SHA1 type import

* Always enable Redux DevTools integration

* Mock git-status for all fetchBranch tests that intrinsically check branch status

* Mock git-status for all updateVersionedMetafile tests that intrinsically check branch status

* Partial removal of strict RootState typing on useAppSelector usage
  • Loading branch information
nelsonni authored Dec 7, 2022
1 parent 29599e9 commit a467a5e
Show file tree
Hide file tree
Showing 99 changed files with 1,603 additions and 1,597 deletions.
14 changes: 12 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,26 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/electron",
"plugin:import/typescript",
"plugin:testing-library/react",
"plugin:react-hooks/recommended",
"plugin:jsdoc/recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"jsdoc/require-param-type": "off"
"jsdoc/require-param-type": "off",
"jsdoc/no-multi-asterisks": [
"warn",
{
"allowWhitespace": true
}
]
// named capture groups require ES2018 as either "lib" or "target", ES6 translates to ES2015
// "prefer-named-capture-group": "error"
},
"settings": {
"import/core-modules": [
"electron"
]
}
}
129 changes: 64 additions & 65 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
"^react-dnd-touch-backend$": "react-dnd-touch-backend/dist/cjs",
"^react-dnd-test-backend$": "react-dnd-test-backend/dist/cjs",
"^react-dnd-test-utils$": "react-dnd-test-utils/dist/cjs",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": '<rootDir>/__mocks__/fileMock.js',
"\\.(css|less)$": 'identity-obj-proxy'
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "identity-obj-proxy"
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"casual": "^1.6.2",
"css-loader": "^6.7.1",
"electron": "21.1.0",
"electron-devtools-installer": "^3.2.0",
"eslint": "^8.25.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.3.4",
Expand Down
65 changes: 44 additions & 21 deletions src/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,18 @@ body {
font-family: 'Lato', Georgia, Serif;
font-weight: bold;
display: grid;
grid-template-columns: [title] auto [buttons];
grid-template-columns: [title] minmax(0, 1fr) [buttons];
align-items: center;
}

.card-header.unmerged {
background: rgba(218, 100, 115, 1);
}

.card-header.unmerged .title {
color: rgba(0, 0, 0, 0.54);
}

.card-header .title {
grid-column-start: title;
margin-left: 5px;
Expand All @@ -103,22 +111,17 @@ body {
.card-back {
width: 100%;
height: calc(100% - 29px);
background: rgba(235, 235, 235, 1);
border-radius: 0 0 10px 10px;
position: absolute;
bottom: 0;
font-family: 'Lato', Georgia, Serif;
}

.card-front {
background: rgba(40, 44, 52, 1);
}


.card-back {
background: rgba(232, 233, 233, 1);
display: grid;
grid-template-columns: minmax(2rem, 1.2fr) minmax(5rem, 3fr);
grid-template-rows: 35px repeat(auto-fill, minmax(1.7rem, 1fr));
grid-template-columns: minmax(0, 1fr);
grid-template-rows: min-content;
row-gap: 0.25rem;
}

Expand All @@ -128,18 +131,27 @@ body {
display: flex;
align-items: center;
column-gap: 5px;
height: fit-content;
}

.card-back .buttons:after {
.card-back div.buttons::after {
content: '';
display: block;
position: absolute;
margin: 0 auto 0 10%;
width: 80%;
padding-top: 35px;
/* margin: 0 auto 0 10%; */
width: 100%;
/* 80% */
padding-top: 28px;
border-bottom: 0.5px solid rgba(0, 0, 0, 0.22);
}

.card-back .area {
grid-row: 2;
grid-column: 1 / 3;
width: 100%;
overflow-y: scroll;
}

.card-back button {
height: 15px;
width: 15px;
Expand Down Expand Up @@ -243,8 +255,6 @@ img.diff_icon {
.list-component {
color: rgba(30, 30, 30, 1);
background: rgba(235, 235, 235, 1);
/* width: 100%; */
height: 100%;
flex-grow: 1;
text-indent: 5px;
border-radius: 0px 0px 10px 10px;
Expand All @@ -253,14 +263,31 @@ img.diff_icon {
white-space: nowrap;
}

.card-front .list-component {
height: 100%;
}

.branch-ribbon-container {
background-color: rgba(88, 90, 194, 1);
color: rgb(200, 210, 220);
}

.branch-ribbon-container.unmerged {
background-color: rgba(218, 100, 115, 1);
color: rgba(0, 0, 0, 0.54);
}

.branch-ribbon-container.preview {
background-color: rgba(72, 74, 212, 0.6);
}

.branch-ribbon {
display: block;
white-space: nowrap;
background-color: rgb(88, 90, 194);
color: rgb(200, 210, 220);
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
padding: 0.3rem;
width: 250px;
}

.branch-ribbon.long:hover {
Expand All @@ -269,10 +296,6 @@ img.diff_icon {
animation-fill-mode: forwards;
}

.branch-ribbon-container {
background-color: rgb(88, 90, 194);
}

@keyframes scroll-text {
0% {
transform: translateX(0%);
Expand Down
93 changes: 0 additions & 93 deletions src/components/BranchList/BranchList.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/BranchList/index.tsx

This file was deleted.

48 changes: 0 additions & 48 deletions src/components/BranchRibbon/BranchRibbon.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/BranchRibbon/index.tsx

This file was deleted.

Loading

0 comments on commit a467a5e

Please sign in to comment.