@@ -161,7 +161,18 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
161
161
const { containerEl } = this ;
162
162
containerEl . empty ( ) ;
163
163
164
- // Add debug mode setting
164
+ this . renderDebugMode ( containerEl ) ;
165
+ this . renderAuthentication ( containerEl ) ;
166
+ this . renderLibrarySettings ( containerEl ) ;
167
+ this . renderSyncSettings ( containerEl ) ;
168
+ this . renderAuthorSettings ( containerEl ) ;
169
+ this . renderHighlightSettings ( containerEl ) ;
170
+ this . renderFilenameSettings ( containerEl ) ;
171
+ this . renderSyncLogging ( containerEl ) ;
172
+ this . renderTemplates ( containerEl ) ;
173
+ }
174
+
175
+ private renderDebugMode ( containerEl : HTMLElement ) : void {
165
176
new Setting ( containerEl )
166
177
. setName ( 'Debug mode' )
167
178
. setDesc ( 'Enable debug logging' )
@@ -173,10 +184,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
173
184
await this . plugin . saveSettings ( ) ;
174
185
} )
175
186
) ;
187
+ }
176
188
177
- // Rest of settings...
178
-
179
- // Authentication section inspired by the official Readwise plugin
189
+ private renderAuthentication ( containerEl : HTMLElement ) : void {
180
190
new Setting ( containerEl ) . setName ( 'Authentication' ) . setHeading ( ) ;
181
191
182
192
let hasValidToken : boolean | null = null ;
@@ -303,7 +313,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
303
313
. setValue ( maskedToken )
304
314
. setDisabled ( true ) ;
305
315
} ) ;
316
+ }
306
317
318
+ private renderLibrarySettings ( containerEl : HTMLElement ) : void {
307
319
new Setting ( containerEl ) . setName ( 'Library' ) . setHeading ( ) ;
308
320
309
321
new Setting ( containerEl )
@@ -319,7 +331,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
319
331
await this . plugin . saveSettings ( ) ;
320
332
} )
321
333
) ;
334
+ }
322
335
336
+ private renderSyncSettings ( containerEl : HTMLElement ) : void {
323
337
new Setting ( containerEl ) . setName ( 'Sync' ) . setHeading ( ) ;
324
338
325
339
new Setting ( containerEl )
@@ -331,7 +345,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
331
345
await this . plugin . saveSettings ( ) ;
332
346
} )
333
347
) ;
348
+ }
334
349
350
+ private renderAuthorSettings ( containerEl : HTMLElement ) : void {
335
351
new Setting ( containerEl )
336
352
. setName ( 'Author names' )
337
353
. setHeading ( )
@@ -380,7 +396,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
380
396
await this . plugin . saveSettings ( ) ;
381
397
} )
382
398
) ;
399
+ }
383
400
401
+ private renderHighlightSettings ( containerEl : HTMLElement ) : void {
384
402
new Setting ( containerEl ) . setName ( 'Highlight organization' ) . setHeading ( ) ;
385
403
386
404
new Setting ( containerEl )
@@ -428,7 +446,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
428
446
await this . plugin . saveSettings ( ) ;
429
447
} )
430
448
) ;
449
+ }
431
450
451
+ private renderFilenameSettings ( containerEl : HTMLElement ) : void {
432
452
new Setting ( containerEl ) . setName ( 'Filenames' ) . setHeading ( ) ;
433
453
434
454
new Setting ( containerEl )
@@ -512,7 +532,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
512
532
} )
513
533
) ;
514
534
}
535
+ }
515
536
537
+ private renderSyncLogging ( containerEl : HTMLElement ) : void {
516
538
new Setting ( containerEl ) . setName ( 'Sync logging' ) . setHeading ( ) ;
517
539
518
540
new Setting ( containerEl )
@@ -522,6 +544,8 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
522
544
toggle . setValue ( this . plugin . settings . logFile ) . onChange ( async ( value ) => {
523
545
this . plugin . settings . logFile = value ;
524
546
await this . plugin . saveSettings ( ) ;
547
+ // Trigger re-render to show/hide log filename setting
548
+ this . display ( ) ;
525
549
} )
526
550
) ;
527
551
@@ -541,7 +565,9 @@ export default class ReadwiseMirrorSettingTab extends PluginSettingTab {
541
565
} )
542
566
) ;
543
567
}
568
+ }
544
569
570
+ private renderTemplates ( containerEl : HTMLElement ) : void {
545
571
new Setting ( containerEl )
546
572
. setName ( 'Templates' )
547
573
. setHeading ( )
0 commit comments