Browse Source

fix(regression): render End of block properties redundantly

fixes https://github.com/logseq/db-test/issues/463
Tienson Qin 6 months ago
parent
commit
93dc7d02b7

+ 2 - 2
src/main/frontend/components/block.cljs

@@ -374,7 +374,7 @@
                                                {:on-click #(shui/popup-hide!)}
                                                (shui/dropdown-menu-item
                                                 {:on-click #(some-> (db/entity [:block/uuid (get-blockid)])
-                                                              (editor-handler/edit-block! :max {:container-id :unknown-container}))}
+                                                                    (editor-handler/edit-block! :max {:container-id :unknown-container}))}
                                                 [:span.flex.items-center.gap-1
                                                  (ui/icon "edit") (t :asset/edit-block)])
                                                (shui/dropdown-menu-item
@@ -2988,7 +2988,7 @@
 
                 (not block-ref?)
                 (assoc mouse-down-key (fn [e]
-                                        (let [journal-title? (:from-journals? config)]
+                                        (let [journal-title? (:journal-page? config)]
                                           (cond
                                             (util/right-click? e)
                                             nil

+ 4 - 0
src/main/frontend/components/block.css

@@ -1089,6 +1089,10 @@ html.is-mac {
   .positioned-properties, .time-spent {
     margin-top: 15px;
   }
+
+  .block-tags {
+    margin-top: 17px;
+  }
 }
 
 .ls-page-title .ls-properties-area {

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -467,7 +467,7 @@
         :hide-children? true
         :container-id container-id
         :show-tag-and-property-classes? true
-        :from-journals? (contains? #{:home :all-journals} (get-in (state/get-route-match) [:data :name]))}
+        :journal-page? (ldb/journal? page)}
        page)]]))
 
 (defn- page-mouse-over

+ 2 - 2
src/main/frontend/components/property.cljs

@@ -563,7 +563,7 @@
              (assoc state
                     ::id (str (random-uuid))
                     ::block block)))}
-  [state _target-block {:keys [page-title? sidebar-properties? tag-dialog?] :as opts}]
+  [state _target-block {:keys [page-title? journal-page? sidebar-properties? tag-dialog?] :as opts}]
   (let [id (::id state)
         db-id (:db/id (::block state))
         block (db/sub-block db-id)
@@ -587,7 +587,7 @@
                           ;; other position
                           (when-not (or show-properties?
                                         (and (:sidebar? opts) (= (:id opts) (str (:block/uuid block))))
-                                        page-title?
+                                        (and page-title? (not journal-page?))
                                         show-empty-and-hidden-properties?)
                             (outliner-property/property-with-other-position? ent))