Просмотр исходного кода

feat(desktop): add hover background to session title and single-click edit (#34589)

usrnk1 2 месяцев назад
Родитель
Сommit
f69f677a32
1 измененных файлов с 11 добавлено и 6 удалено
  1. 11 6
      packages/app/src/pages/session/timeline/message-timeline.tsx

+ 11 - 6
packages/app/src/pages/session/timeline/message-timeline.tsx

@@ -1357,7 +1357,7 @@ export function MessageTimeline(props: {
               "w-full": true,
               "pb-4": true,
               "pr-3": true,
-              "pl-4": settings.general.newLayoutDesigns(),
+              "pl-2": settings.general.newLayoutDesigns(),
               "pl-2 md:pl-4": !settings.general.newLayoutDesigns(),
               "md:max-w-200 md:mx-auto 2xl:max-w-[1000px]": props.centered && !settings.general.newLayoutDesigns(),
             }}
@@ -1393,8 +1393,13 @@ export function MessageTimeline(props: {
                       fallback={
                         <h1
                           data-slot="session-title-child"
-                          class="text-14-medium text-text-strong truncate grow-1 min-w-0"
-                          onDblClick={openTitleEditor}
+                          classList={{
+                            "text-14-medium text-text-strong truncate": true,
+                            "w-fit rounded-[6px] px-2 py-1 hover:bg-v2-overlay-simple-overlay-hover":
+                              settings.general.newLayoutDesigns(),
+                            "grow-1 min-w-0": !settings.general.newLayoutDesigns(),
+                          }}
+                          onClick={openTitleEditor}
                         >
                           {childTitle()}
                         </h1>
@@ -1408,10 +1413,10 @@ export function MessageTimeline(props: {
                         value={title.draft}
                         disabled={titleMutation.isPending}
                         classList={{
-                          "text-14-medium text-text-strong grow-1 min-w-0 pl-1 -ml-1": true,
-                          "h-6 leading-4 rounded-[3px] focus:shadow-none focus:outline focus:outline-1 focus:outline-offset-[-1px] focus:outline-v2-border-border-focus":
+                          "text-14-medium text-text-strong grow-1 min-w-0 pl-1 ml-1": true,
+                          "grow-1 min-w-0 pl-1 -ml-1 rounded-[6px]": !settings.general.newLayoutDesigns(),
+                          "rounded-[6px] -ml-2 px-2 py-1 h-6 leading-4 focus:shadow-none focus:outline focus:outline-1 focus:outline-offset-[-1px] focus:outline-v2-border-border-focus":
                             settings.general.newLayoutDesigns(),
-                          "rounded-[6px]": !settings.general.newLayoutDesigns(),
                         }}
                         style={{
                           "--inline-input-shadow": settings.general.newLayoutDesigns()