From 841a84e778ab858d5071f5c26901f682fe5ca390 Mon Sep 17 00:00:00 2001 From: David Morlitz Date: Wed, 29 Nov 2023 11:25:11 -0500 Subject: [PATCH 1/5] Beginning of overdue highlighting in header listing --- .../OrgFile/components/Header/.index.js.swp | Bin 0 -> 1024 bytes .../OrgFile/components/Header/index.js | 20 +++++++++++++++++- .../components/TitleLine/.index.js.swp | Bin 1024 -> 1024 bytes .../OrgFile/components/TitleLine/index.js | 13 +++++++++++- .../components/TitleLine/stylesheet.css | 5 +++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/components/OrgFile/components/Header/.index.js.swp diff --git a/src/components/OrgFile/components/Header/.index.js.swp b/src/components/OrgFile/components/Header/.index.js.swp new file mode 100644 index 0000000000000000000000000000000000000000..23e1967186d533b3f82ae728229752bd72b8ed52 GIT binary patch literal 1024 zcmYc?$V<%2S1{8vVn6{8qL~;{a`TIFGE1sZB(QK2%QDLnv52D!W#*-%R_J9Fql=I7 QM?+vV1n3e1q3E^%00rF*HUIzs literal 0 HcmV?d00001 diff --git a/src/components/OrgFile/components/Header/index.js b/src/components/OrgFile/components/Header/index.js index 418afd48d..5b822b76e 100644 --- a/src/components/OrgFile/components/Header/index.js +++ b/src/components/OrgFile/components/Header/index.js @@ -361,6 +361,23 @@ ${header.get('rawDescription')}`; headerDeadlineMap.get('year') : ''; + const today = new Date(); + const headerDate = + headerDeadlineMap !== undefined + ? new Date( + headerDeadlineMap.get('month') + + '-' + + headerDeadlineMap.get('day') + + '-' + + headerDeadlineMap.get('year') + ) + : today; + + var headerOverdue = (today, headerDate) => + new Date(headerDate).setHours(0, 0, 0, 0) < new Date(today).setHours(0, 0, 0, 0); + + var headerOverdueValue = new Date(headerDate).setHours(0, 0, 0, 0) - new Date(today).setHours(0, 0, 0, 0); + const { dragStartX, currentDragX, @@ -517,7 +534,8 @@ ${header.get('rawDescription')}`; // Spacing between 'clock display' and 'deadline // display' overlays (showClockDisplay && showDeadlineDisplay ? ' ' : '') + - (showDeadlineDisplay && headerDeadline !== undefined ? headerDeadline : '') + (showDeadlineDisplay && headerDeadline !== undefined ? headerDeadline : '') + + headerOverdueValue } /> diff --git a/src/components/OrgFile/components/TitleLine/.index.js.swp b/src/components/OrgFile/components/TitleLine/.index.js.swp index 5c35d7563f4bf10925fe29469c940a9448894974..db434967f296ae9165279b567a6561a497ed60e1 100644 GIT binary patch delta 14 VcmZqRXyBM2!JHe%v{CvgGXNfW1U&!% delta 14 VcmZqRXyBM2!CV^8uu=LcGXNf~1VjJ; diff --git a/src/components/OrgFile/components/TitleLine/index.js b/src/components/OrgFile/components/TitleLine/index.js index cb9f1b668..774ea2779 100644 --- a/src/components/OrgFile/components/TitleLine/index.js +++ b/src/components/OrgFile/components/TitleLine/index.js @@ -104,6 +104,7 @@ class TitleLine extends PureComponent { shouldDisableExplicitWidth, todoKeywordSets, addition, + headerOverdueValue, } = this.props; const { containerWidth } = this.state; @@ -123,6 +124,16 @@ class TitleLine extends PureComponent { whiteSpace: 'nowrap', }; + const additionOverdueStyle = { + color: 'red', + minWidth: '5em', + textAlign: 'right', + marginRight: '2em', + whiteSpace: 'nowrap', + }; + + const additionStyleDisplay = (headerOverdueValue < 0) ? additionOverdueStyle : additionStyle; + return (
{!header.get('opened') && hasContent ? '...' : ''} - {addition ? {addition} : null} + {addition ? {addition} {(headerOverdueValue < 0) ? 'OVERDUE' : 'FUTURE'} {headerOverdueValue} : null}
{header.getIn(['titleLine', 'tags']).size > 0 && (
diff --git a/src/components/OrgFile/components/TitleLine/stylesheet.css b/src/components/OrgFile/components/TitleLine/stylesheet.css index 2e255dca1..081525d16 100644 --- a/src/components/OrgFile/components/TitleLine/stylesheet.css +++ b/src/components/OrgFile/components/TitleLine/stylesheet.css @@ -57,3 +57,8 @@ display: flex; justify-content: space-between; } + +.title-line-overdue { + color: var(--red); +} + From 5689e024531d9cdad1b07431390ab8e2cd9352ef Mon Sep 17 00:00:00 2001 From: David Morlitz Date: Wed, 29 Nov 2023 15:09:12 -0500 Subject: [PATCH 2/5] Added visual cue for overdue headers - when showing the header on the right side of each line --- .../OrgFile/components/Header/.index.js.swp | Bin 1024 -> 1024 bytes .../OrgFile/components/Header/index.js | 8 ++------ .../OrgFile/components/TitleLine/index.js | 14 ++------------ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/components/OrgFile/components/Header/.index.js.swp b/src/components/OrgFile/components/Header/.index.js.swp index 23e1967186d533b3f82ae728229752bd72b8ed52..98606451ad9b7a7ec0423b0b0b5ad7faa69a8185 100644 GIT binary patch delta 13 UcmZqRXyBM2!Bo|-QR*2p036r^X#fBK delta 13 UcmZqRXyBM2!So<{qtr8I03L$`ssI20 diff --git a/src/components/OrgFile/components/Header/index.js b/src/components/OrgFile/components/Header/index.js index 5b822b76e..78a781cdc 100644 --- a/src/components/OrgFile/components/Header/index.js +++ b/src/components/OrgFile/components/Header/index.js @@ -373,10 +373,7 @@ ${header.get('rawDescription')}`; ) : today; - var headerOverdue = (today, headerDate) => - new Date(headerDate).setHours(0, 0, 0, 0) < new Date(today).setHours(0, 0, 0, 0); - - var headerOverdueValue = new Date(headerDate).setHours(0, 0, 0, 0) - new Date(today).setHours(0, 0, 0, 0); + const headerSecondsToDue = new Date(headerDate).setHours(0, 0, 0, 0) - new Date(today).setHours(0, 0, 0, 0); const { dragStartX, @@ -534,8 +531,7 @@ ${header.get('rawDescription')}`; // Spacing between 'clock display' and 'deadline // display' overlays (showClockDisplay && showDeadlineDisplay ? ' ' : '') + - (showDeadlineDisplay && headerDeadline !== undefined ? headerDeadline : '') + - headerOverdueValue + (showDeadlineDisplay && headerDeadline !== undefined ? (headerSecondsToDue < 0 ? '**' : '') + headerDeadline + (headerSecondsToDue < 0 ? '**' : '') : '') } /> diff --git a/src/components/OrgFile/components/TitleLine/index.js b/src/components/OrgFile/components/TitleLine/index.js index 774ea2779..c333c10ea 100644 --- a/src/components/OrgFile/components/TitleLine/index.js +++ b/src/components/OrgFile/components/TitleLine/index.js @@ -104,7 +104,7 @@ class TitleLine extends PureComponent { shouldDisableExplicitWidth, todoKeywordSets, addition, - headerOverdueValue, + headerSecondsToDue, } = this.props; const { containerWidth } = this.state; @@ -124,16 +124,6 @@ class TitleLine extends PureComponent { whiteSpace: 'nowrap', }; - const additionOverdueStyle = { - color: 'red', - minWidth: '5em', - textAlign: 'right', - marginRight: '2em', - whiteSpace: 'nowrap', - }; - - const additionStyleDisplay = (headerOverdueValue < 0) ? additionOverdueStyle : additionStyle; - return (
{!header.get('opened') && hasContent ? '...' : ''} - {addition ? {addition} {(headerOverdueValue < 0) ? 'OVERDUE' : 'FUTURE'} {headerOverdueValue} : null} + {addition ? {addition} : null}
{header.getIn(['titleLine', 'tags']).size > 0 && (
From 0fd6f09e7939d97df00e84013d3aaf14f8547222 Mon Sep 17 00:00:00 2001 From: David Morlitz Date: Wed, 29 Nov 2023 15:14:31 -0500 Subject: [PATCH 3/5] Removed unused variable --- .../components/TitleLine/.index.js.swp | Bin 1024 -> 0 bytes .../OrgFile/components/TitleLine/hardcopy.0 | 40 ++++++++++++++++++ .../OrgFile/components/TitleLine/index.js | 1 - 3 files changed, 40 insertions(+), 1 deletion(-) delete mode 100644 src/components/OrgFile/components/TitleLine/.index.js.swp create mode 100644 src/components/OrgFile/components/TitleLine/hardcopy.0 diff --git a/src/components/OrgFile/components/TitleLine/.index.js.swp b/src/components/OrgFile/components/TitleLine/.index.js.swp deleted file mode 100644 index db434967f296ae9165279b567a6561a497ed60e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{8vVn6}8aZC&;x%ovonI%;y5?DBiWtnA(Sj5qVGV@YWEA+C8(Zxsk PqaiRF0(1$1P;^@WP&^FA diff --git a/src/components/OrgFile/components/TitleLine/hardcopy.0 b/src/components/OrgFile/components/TitleLine/hardcopy.0 new file mode 100644 index 000000000..052f795fa --- /dev/null +++ b/src/components/OrgFile/components/TitleLine/hardcopy.0 @@ -0,0 +1,40 @@ + GNU nano 6.2 index.js + + ) : ( + '' + )} + + { +
+
+ + + {!header.get('opened') && hasContent ? '...' : ''} + + {addition ? {addition} : null} +
+ {header.getIn(['titleLine', 'tags']).size > 0 && ( +
+ {header + .getIn(['titleLine', 'tags']) + .toSet() + .toList() + .filter((tag) => !!tag) + .map((tag) => ( +
+ {tag} +
+ ))} +
+ )} +
+ } + [ Wrote 208 lines ] +^G Help ^O Write Out ^W Where Is ^K Cut ^T Execute ^C Location M-U Undo M-A Set Mark M-] To Bracket +^X Exit ^R Read File ^\ Replace ^U Paste ^J Justify ^/ Go To Line M-E Redo M-6 Copy ^Q Where Was diff --git a/src/components/OrgFile/components/TitleLine/index.js b/src/components/OrgFile/components/TitleLine/index.js index c333c10ea..cb9f1b668 100644 --- a/src/components/OrgFile/components/TitleLine/index.js +++ b/src/components/OrgFile/components/TitleLine/index.js @@ -104,7 +104,6 @@ class TitleLine extends PureComponent { shouldDisableExplicitWidth, todoKeywordSets, addition, - headerSecondsToDue, } = this.props; const { containerWidth } = this.state; From 63dbed3f24665e3330045c1b4af72ea3f9270eca Mon Sep 17 00:00:00 2001 From: David Morlitz Date: Wed, 29 Nov 2023 15:22:06 -0500 Subject: [PATCH 4/5] Ran prettier-eslint --- .../OrgFile/components/Header/index.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/OrgFile/components/Header/index.js b/src/components/OrgFile/components/Header/index.js index 78a781cdc..c86e3807c 100644 --- a/src/components/OrgFile/components/Header/index.js +++ b/src/components/OrgFile/components/Header/index.js @@ -362,18 +362,19 @@ ${header.get('rawDescription')}`; : ''; const today = new Date(); - const headerDate = + const headerDate = headerDeadlineMap !== undefined ? new Date( headerDeadlineMap.get('month') + - '-' + - headerDeadlineMap.get('day') + - '-' + - headerDeadlineMap.get('year') + '-' + + headerDeadlineMap.get('day') + + '-' + + headerDeadlineMap.get('year') ) : today; - const headerSecondsToDue = new Date(headerDate).setHours(0, 0, 0, 0) - new Date(today).setHours(0, 0, 0, 0); + const headerSecondsToDue = + new Date(headerDate).setHours(0, 0, 0, 0) - new Date(today).setHours(0, 0, 0, 0); const { dragStartX, @@ -531,7 +532,11 @@ ${header.get('rawDescription')}`; // Spacing between 'clock display' and 'deadline // display' overlays (showClockDisplay && showDeadlineDisplay ? ' ' : '') + - (showDeadlineDisplay && headerDeadline !== undefined ? (headerSecondsToDue < 0 ? '**' : '') + headerDeadline + (headerSecondsToDue < 0 ? '**' : '') : '') + (showDeadlineDisplay && headerDeadline !== undefined + ? (headerSecondsToDue < 0 ? '**' : '') + + headerDeadline + + (headerSecondsToDue < 0 ? '**' : '') + : '') } /> From 8d34f7dda8ea11b6a8fd4053779572740650eded Mon Sep 17 00:00:00 2001 From: David Morlitz Date: Wed, 29 Nov 2023 16:44:29 -0500 Subject: [PATCH 5/5] Reformatted date construction --- .../OrgFile/components/Header/.index.js.swp | Bin 1024 -> 0 bytes .../OrgFile/components/Header/index.js | 8 ++-- .../OrgFile/components/TitleLine/hardcopy.0 | 40 ------------------ 3 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 src/components/OrgFile/components/Header/.index.js.swp delete mode 100644 src/components/OrgFile/components/TitleLine/hardcopy.0 diff --git a/src/components/OrgFile/components/Header/.index.js.swp b/src/components/OrgFile/components/Header/.index.js.swp deleted file mode 100644 index 98606451ad9b7a7ec0423b0b0b5ad7faa69a8185..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{8vVn6{^4NMFvx%ovonI%;y5?DBiWtnA(Sj5qVGV@YWEA+C8(Zxsk PqaiRF0(1$1P;^@W2f+;W diff --git a/src/components/OrgFile/components/Header/index.js b/src/components/OrgFile/components/Header/index.js index c86e3807c..05476b828 100644 --- a/src/components/OrgFile/components/Header/index.js +++ b/src/components/OrgFile/components/Header/index.js @@ -365,11 +365,9 @@ ${header.get('rawDescription')}`; const headerDate = headerDeadlineMap !== undefined ? new Date( - headerDeadlineMap.get('month') + - '-' + - headerDeadlineMap.get('day') + - '-' + - headerDeadlineMap.get('year') + headerDeadlineMap.get('year'), + headerDeadlineMap.get('month'), + headerDeadlineMap.get('day') ) : today; diff --git a/src/components/OrgFile/components/TitleLine/hardcopy.0 b/src/components/OrgFile/components/TitleLine/hardcopy.0 deleted file mode 100644 index 052f795fa..000000000 --- a/src/components/OrgFile/components/TitleLine/hardcopy.0 +++ /dev/null @@ -1,40 +0,0 @@ - GNU nano 6.2 index.js - - ) : ( - '' - )} - - { -
-
- - - {!header.get('opened') && hasContent ? '...' : ''} - - {addition ? {addition} : null} -
- {header.getIn(['titleLine', 'tags']).size > 0 && ( -
- {header - .getIn(['titleLine', 'tags']) - .toSet() - .toList() - .filter((tag) => !!tag) - .map((tag) => ( -
- {tag} -
- ))} -
- )} -
- } - [ Wrote 208 lines ] -^G Help ^O Write Out ^W Where Is ^K Cut ^T Execute ^C Location M-U Undo M-A Set Mark M-] To Bracket -^X Exit ^R Read File ^\ Replace ^U Paste ^J Justify ^/ Go To Line M-E Redo M-6 Copy ^Q Where Was