@@ -4,7 +4,7 @@ import { throttle } from "lodash-es"
4
4
import type { PropsWithChildren } from "react"
5
5
import React , { useEffect , useRef , useState } from "react"
6
6
import { useHotkeys } from "react-hotkeys-hook"
7
- import { useTranslation } from "react-i18next"
7
+ import { Trans , useTranslation } from "react-i18next"
8
8
import { useResizable } from "react-resizable-layout"
9
9
import { Outlet } from "react-router-dom"
10
10
@@ -15,12 +15,14 @@ import { useLoginModalShow, useWhoami } from "~/atoms/user"
15
15
import { AppErrorBoundary } from "~/components/common/AppErrorBoundary"
16
16
import { ErrorComponentType } from "~/components/errors/enum"
17
17
import { PanelSplitter } from "~/components/ui/divider"
18
+ import { Kbd } from "~/components/ui/kbd/Kbd"
18
19
import { DeclarativeModal } from "~/components/ui/modal/stacked/declarative-modal"
19
20
import { NoopChildren } from "~/components/ui/modal/stacked/utils"
20
21
import { RootPortal } from "~/components/ui/portal"
21
22
import { HotKeyScopeMap } from "~/constants"
22
23
import { shortcuts } from "~/constants/shortcuts"
23
24
import { useDailyTask } from "~/hooks/biz/useDailyTask"
25
+ import { useI18n } from "~/hooks/common"
24
26
import { preventDefault } from "~/lib/dom"
25
27
import { cn } from "~/lib/utils"
26
28
import { EnvironmentIndicator } from "~/modules/app/EnvironmentIndicator"
@@ -200,6 +202,7 @@ const FeedResponsiveResizerContainer = ({
200
202
timer = clearTimeout ( timer )
201
203
}
202
204
} , [ feedColumnShow ] )
205
+ const t = useI18n ( )
203
206
204
207
return (
205
208
< >
@@ -217,9 +220,6 @@ const FeedResponsiveResizerContainer = ({
217
220
"--fo-feed-col-w" : `${ position } px` ,
218
221
} }
219
222
>
220
- { /* {React.cloneElement(children, {
221
- className: "!bg-native",
222
- }) } */ }
223
223
< Slot className = { ! feedColumnShow ? "!bg-native" : "" } > { children } </ Slot >
224
224
</ div >
225
225
@@ -231,7 +231,34 @@ const FeedResponsiveResizerContainer = ({
231
231
/>
232
232
233
233
{ delayShowSplitter && (
234
- < PanelSplitter isDragging = { isDragging } cursor = { separatorCursor } { ...separatorProps } />
234
+ < PanelSplitter
235
+ isDragging = { isDragging }
236
+ cursor = { separatorCursor }
237
+ { ...separatorProps }
238
+ onDoubleClick = { ( ) => {
239
+ setFeedColumnShow ( false )
240
+ } }
241
+ tooltip = {
242
+ ! isDragging && (
243
+ < >
244
+ < div >
245
+ { /* <b>Drag</b> to resize */ }
246
+ < Trans t = { t } i18nKey = "resize.tooltip.drag_to_resize" components = { { b : < b /> } } />
247
+ </ div >
248
+ < div className = "center" >
249
+ < span >
250
+ < Trans
251
+ t = { t }
252
+ i18nKey = "resize.tooltip.double_click_to_collapse"
253
+ components = { { b : < b /> } }
254
+ />
255
+ </ span > { " " }
256
+ < Kbd className = "ml-1" > { "[" } </ Kbd >
257
+ </ div >
258
+ </ >
259
+ )
260
+ }
261
+ />
235
262
) }
236
263
</ >
237
264
)
0 commit comments