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 , ArrowDownToLine , ArrowUpToLine } from "lucide" ;
4
+ import { createElement , FilePlus2 , Trash , ArrowDownToLine , ArrowUpToLine , FileText } from "lucide" ;
5
5
6
6
import { log } from "./moreOnLog" ;
7
7
import { FileOrFolderMixedState } from "./baseTypes" ;
@@ -71,20 +71,28 @@ export class TouchedPlanModel extends Modal {
71
71
} ) ;
72
72
const ulRemote = contentEl . createEl ( "ul" ) ;
73
73
toRemoteFiles . forEach ( ( val ) => {
74
- const li = ulRemote . createEl ( "li" , {
75
- text : val . key ,
76
- cls : 'file-item-action'
77
- } ) ;
78
- if ( val . decision === 'uploadLocalToRemote' ) {
79
- const iconSvgCreate = createElement ( FilePlus2 ) ;
80
- iconSvgCreate . addClass ( 'file-item-action-icon' )
81
- li . appendChild ( iconSvgCreate )
82
- } else {
83
- const iconSvgTrash = createElement ( Trash ) ;
84
- iconSvgTrash . addClass ( 'file-item-action-icon' )
85
- li . appendChild ( iconSvgTrash )
86
- }
74
+ const li = ulRemote . createEl ( 'li' , {
75
+ cls : 'file-item-action'
76
+ } ) ;
77
+ const fileIcon = createElement ( FileText ) ;
78
+ fileIcon . addClass ( 'file-item-action-prefix' )
79
+ li . appendChild ( fileIcon ) ;
80
+
81
+ li . createEl ( 'span' , {
82
+ text : val . key ,
83
+ cls : 'file-item-action-name'
87
84
} ) ;
85
+
86
+ if ( val . decision === 'uploadLocalToRemote' ) {
87
+ const iconSvgCreate = createElement ( FilePlus2 ) ;
88
+ iconSvgCreate . addClass ( 'file-item-action-icon' )
89
+ li . appendChild ( iconSvgCreate )
90
+ } else {
91
+ const iconSvgTrash = createElement ( Trash ) ;
92
+ iconSvgTrash . addClass ( 'file-item-action-icon' )
93
+ li . appendChild ( iconSvgTrash )
94
+ }
95
+ } ) ;
88
96
}
89
97
90
98
@@ -94,10 +102,18 @@ export class TouchedPlanModel extends Modal {
94
102
} ) ;
95
103
const ulLocal = contentEl . createEl ( "ul" ) ;
96
104
toLocalFiles . forEach ( ( val ) => {
97
- const li = ulLocal . createEl ( "li" , {
98
- text : val . key ,
105
+ const li = ulLocal . createEl ( 'li' , {
99
106
cls : 'file-item-action'
100
107
} ) ;
108
+ const fileIcon = createElement ( FileText ) ;
109
+ fileIcon . addClass ( 'file-item-action-prefix' )
110
+ li . appendChild ( fileIcon ) ;
111
+
112
+ li . createEl ( 'span' , {
113
+ text : val . key ,
114
+ cls : 'file-item-action-name'
115
+ } ) ;
116
+
101
117
if ( val . decision === 'downloadRemoteToLocal' ) {
102
118
const iconSvgCreate = createElement ( FilePlus2 ) ;
103
119
iconSvgCreate . addClass ( 'file-item-action-icon' )
@@ -116,10 +132,18 @@ export class TouchedPlanModel extends Modal {
116
132
} ) ;
117
133
const ulConflict = contentEl . createEl ( "ul" ) ;
118
134
conflictFiles . forEach ( ( val ) => {
119
- const li = ulConflict . createEl ( "li" , {
120
- text : val . key ,
135
+ const li = ulConflict . createEl ( 'li' , {
121
136
cls : 'file-item-action'
122
137
} ) ;
138
+ const fileIcon = createElement ( FileText ) ;
139
+ fileIcon . addClass ( 'file-item-action-prefix' )
140
+ li . appendChild ( fileIcon ) ;
141
+
142
+ li . createEl ( 'span' , {
143
+ text : val . key ,
144
+ cls : 'file-item-action-name'
145
+ } ) ;
146
+
123
147
if ( val . decision === 'downloadRemoteToLocal' ) {
124
148
const iconSvgSyncDown = createElement ( ArrowDownToLine ) ;
125
149
iconSvgSyncDown . addClass ( 'file-item-action-icon' )
0 commit comments