1
1
import { App , Modal , Notice , PluginSettingTab , Setting } from "obsidian" ;
2
2
import type InvioPlugin from "./main" ; // unavoidable
3
3
import type { TransItemType } from "./i18n" ;
4
- import { createElement , FilePlus2 , Trash } from "lucide" ;
4
+ import { createElement , FilePlus2 , Trash , ArrowDownToLine , ArrowUpToLine } from "lucide" ;
5
5
6
6
import { log } from "./moreOnLog" ;
7
7
import { FileOrFolderMixedState } from "./baseTypes" ;
@@ -65,9 +65,9 @@ export class TouchedPlanModel extends Modal {
65
65
cls : 'file-item-action'
66
66
} ) ;
67
67
if ( val . decision === 'uploadLocalToRemote' ) {
68
- const iconSvgSyncPending = createElement ( FilePlus2 ) ;
69
- iconSvgSyncPending . addClass ( 'file-item-action-icon' )
70
- li . appendChild ( iconSvgSyncPending )
68
+ const iconSvgCreate = createElement ( FilePlus2 ) ;
69
+ iconSvgCreate . addClass ( 'file-item-action-icon' )
70
+ li . appendChild ( iconSvgCreate )
71
71
} else {
72
72
const iconSvgTrash = createElement ( Trash ) ;
73
73
iconSvgTrash . addClass ( 'file-item-action-icon' )
@@ -83,10 +83,20 @@ export class TouchedPlanModel extends Modal {
83
83
} ) ;
84
84
const ulLocal = contentEl . createEl ( "ul" ) ;
85
85
toLocalFiles . forEach ( ( val ) => {
86
- ulLocal . createEl ( "li" , {
87
- text : val . key + ' - ' + ( val . decision === 'downloadRemoteToLocal' ? '➕' : '➖' ) ,
88
- } ) ;
86
+ const li = ulLocal . createEl ( "li" , {
87
+ text : val . key ,
88
+ cls : 'file-item-action'
89
89
} ) ;
90
+ if ( val . decision === 'downloadRemoteToLocal' ) {
91
+ const iconSvgCreate = createElement ( FilePlus2 ) ;
92
+ iconSvgCreate . addClass ( 'file-item-action-icon' )
93
+ li . appendChild ( iconSvgCreate )
94
+ } else {
95
+ const iconSvgTrash = createElement ( Trash ) ;
96
+ iconSvgTrash . addClass ( 'file-item-action-icon' )
97
+ li . appendChild ( iconSvgTrash )
98
+ }
99
+ } ) ;
90
100
}
91
101
92
102
if ( conflictFiles . length > 0 ) {
@@ -95,9 +105,19 @@ export class TouchedPlanModel extends Modal {
95
105
} ) ;
96
106
const ulConflict = contentEl . createEl ( "ul" ) ;
97
107
conflictFiles . forEach ( ( val ) => {
98
- ulConflict . createEl ( "li" , {
99
- text : val . key + ' - Override ' + ( val . decision === 'downloadRemoteToLocal' ? 'Local' : 'Remote' ) ,
100
- } ) ;
108
+ const li = ulConflict . createEl ( "li" , {
109
+ text : val . key ,
110
+ cls : 'file-item-action'
111
+ } ) ;
112
+ if ( val . decision === 'downloadRemoteToLocal' ) {
113
+ const iconSvgSyncDown = createElement ( ArrowDownToLine ) ;
114
+ iconSvgSyncDown . addClass ( 'file-item-action-icon' )
115
+ li . appendChild ( iconSvgSyncDown )
116
+ } else {
117
+ const iconSvgUp = createElement ( ArrowUpToLine ) ;
118
+ iconSvgUp . addClass ( 'file-item-action-icon' )
119
+ li . appendChild ( iconSvgUp )
120
+ }
101
121
} ) ;
102
122
contentEl . createEl ( 'p' , {
103
123
text : 'Warnning: Don\'t worry, to prevent data loss, conflicting files will generate a .conflict.md backup file with the overwritten content to your local folder.'
0 commit comments