Răsfoiți Sursa

enhance(ui): polish layout details for the file graph editor

charlie 2 luni în urmă
părinte
comite
ffb4d17f6e

+ 1 - 1
src/main/frontend/components/cmdk/core.cljs

@@ -885,7 +885,7 @@
       {:class "text-xl bg-transparent border-none w-full outline-none px-3 py-3"
        :auto-focus true
        :autoComplete "off"
-       :autoCapitalize false
+       :autoCapitalize "off"
        :placeholder (input-placeholder false)
        :ref #(when-not @input-ref (reset! input-ref %))
        :on-change debounced-on-change

+ 1 - 0
src/main/frontend/components/theme.cljs

@@ -95,6 +95,7 @@
     (hooks/use-effect!
      (fn []
        (ui-handler/reset-custom-css!)
+       (ui-handler/set-file-graph-flag! (false? (config/db-based-graph? current-repo)))
        (pdf/reset-current-pdf!)
        (plugin-handler/hook-plugin-app :current-graph-changed {}))
      [current-repo])

+ 16 - 0
src/main/frontend/components/theme.css

@@ -36,6 +36,22 @@
   }
 }
 
+html.is-file-graph {
+  #main-content-container {
+    @apply pt-2;
+  }
+
+  .page-inner {
+    @apply sm:gap-2;
+  }
+
+  .sidebar-item {
+    .ls-page-blocks {
+      @apply pt-4;
+    }
+  }
+}
+
 .hide-scrollbar {
   -ms-overflow-style: none; /* IE and Edge */
   scrollbar-width: none !important; /* Firefox */

+ 5 - 0
src/main/frontend/handler/ui.cljs

@@ -124,6 +124,11 @@
     (dom/remove! el-style))
   (add-style-if-exists!))
 
+(defn set-file-graph-flag!
+  [file-graph?]
+  (apply (if file-graph? dom/add-class! dom/remove-class!)
+         [js/document.documentElement "is-file-graph"]))
+
 (def *js-execed (atom #{}))
 
 (defn exec-js-if-exists-&-allowed!