retold-remote 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -333,6 +333,31 @@ const _ViewConfiguration =
333
333
  border-color: var(--retold-text-muted);
334
334
  background: rgba(128, 128, 128, 0.06);
335
335
  }
336
+ .retold-remote-topbar-aisort-btn
337
+ {
338
+ padding: 4px 8px;
339
+ border: 1px solid var(--retold-border);
340
+ border-radius: 3px;
341
+ background: transparent;
342
+ color: var(--retold-text-muted);
343
+ font-size: 0.72rem;
344
+ cursor: pointer;
345
+ transition: color 0.15s, border-color 0.15s, background 0.15s;
346
+ font-family: inherit;
347
+ white-space: nowrap;
348
+ }
349
+ .retold-remote-topbar-aisort-btn:hover
350
+ {
351
+ color: var(--retold-text-primary);
352
+ border-color: var(--retold-accent);
353
+ background: rgba(128, 128, 128, 0.1);
354
+ }
355
+ .retold-remote-topbar-aisort-btn.generating
356
+ {
357
+ color: var(--retold-accent);
358
+ border-color: var(--retold-accent);
359
+ cursor: wait;
360
+ }
336
361
  .retold-remote-topbar-filter-badge
337
362
  {
338
363
  position: absolute;
@@ -362,6 +387,7 @@ const _ViewConfiguration =
362
387
  <div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>
363
388
  <div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>
364
389
  <div class="retold-remote-topbar-actions">
390
+ <button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views['ContentEditor-TopBar'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">AI Sort</button>
365
391
  <button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views['ContentEditor-TopBar'].addToCollection(event)" title="Add to collection">+&#9733;</button>
366
392
  <button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views['ContentEditor-TopBar'].toggleCollections()" title="Toggle Collections panel (b)">&#9733;</button>
367
393
  <button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views['ContentEditor-TopBar'].toggleFilterBar()" title="Toggle filter bar (/)">&#9698;</button>
@@ -694,9 +720,11 @@ class RetoldRemoteTopBarView extends libPictView
694
720
 
695
721
  /**
696
722
  * Update the info display with folder summary.
723
+ * Also updates the AI Sort button visibility.
697
724
  */
698
725
  updateInfo()
699
726
  {
727
+ this.updateAISortButton();
700
728
  let tmpInfoEl = document.getElementById('RetoldRemote-TopBar-Info');
701
729
  if (!tmpInfoEl)
702
730
  {
@@ -746,6 +774,64 @@ class RetoldRemoteTopBarView extends libPictView
746
774
  tmpInfoEl.textContent = tmpParts.join(' \u00b7 ');
747
775
  }
748
776
 
777
+ // -- AI Sort ----------------------------------------------------------
778
+
779
+ /**
780
+ * Trigger AI sort for the current folder.
781
+ */
782
+ triggerAISort()
783
+ {
784
+ let tmpAISortManager = this.pict.providers['RetoldRemote-AISortManager'];
785
+ if (!tmpAISortManager)
786
+ {
787
+ return;
788
+ }
789
+
790
+ let tmpCurrentPath = (this.pict.AppData.PictFileBrowser && this.pict.AppData.PictFileBrowser.CurrentLocation) || '';
791
+
792
+ // Show generating state
793
+ let tmpBtn = document.getElementById('RetoldRemote-TopBar-AISortBtn');
794
+ if (tmpBtn)
795
+ {
796
+ tmpBtn.classList.add('generating');
797
+ tmpBtn.textContent = 'Sorting...';
798
+ }
799
+
800
+ tmpAISortManager.generateSortPlan(tmpCurrentPath,
801
+ (pError, pResult) =>
802
+ {
803
+ // Reset button state
804
+ if (tmpBtn)
805
+ {
806
+ tmpBtn.classList.remove('generating');
807
+ tmpBtn.textContent = 'AI Sort';
808
+ }
809
+ });
810
+ }
811
+
812
+ /**
813
+ * Update the AI Sort button visibility.
814
+ * Shows only when browsing a folder (gallery mode).
815
+ */
816
+ updateAISortButton()
817
+ {
818
+ let tmpBtn = document.getElementById('RetoldRemote-TopBar-AISortBtn');
819
+ if (!tmpBtn)
820
+ {
821
+ return;
822
+ }
823
+
824
+ let tmpAISortManager = this.pict.providers['RetoldRemote-AISortManager'];
825
+ if (tmpAISortManager && tmpAISortManager.isAvailable())
826
+ {
827
+ tmpBtn.style.display = '';
828
+ }
829
+ else
830
+ {
831
+ tmpBtn.style.display = 'none';
832
+ }
833
+ }
834
+
749
835
  // -- Collections Panel ------------------------------------------------
750
836
 
751
837
  /**
@@ -12,6 +12,7 @@ html, body
12
12
  margin: 0;
13
13
  padding: 0;
14
14
  height: 100%;
15
+ height: 100dvh;
15
16
  overflow: hidden;
16
17
  background: var(--retold-bg-primary);
17
18
  color: var(--retold-text-primary);
@@ -20,6 +21,8 @@ html, body
20
21
  line-height: 1.5;
21
22
  -webkit-font-smoothing: antialiased;
22
23
  -moz-osx-font-smoothing: grayscale;
24
+ /* Safe area insets for notched devices */
25
+ padding-bottom: env(safe-area-inset-bottom);
23
26
  }
24
27
 
25
28
  /* Scrollbar styling */
@@ -2,7 +2,7 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
6
6
  <title>Retold Remote</title>
7
7
  <link rel="stylesheet" href="css/retold-remote.css">
8
8
  <style id="PICT-CSS"></style>