Merge pull request #32968 from overleaf/worktree-labs-feature-preview

Add labs preview modal to editor

GitOrigin-RevId: 0df33135febc8e94129bcdfdfb5c4981326dfab0
This commit is contained in:
Malik Glossop
2026-05-25 08:05:28 +00:00
committed by Copybot
parent 24ba0b86b1
commit eb9d586bdb
20 changed files with 761 additions and 69 deletions
@@ -25,7 +25,15 @@ export type RailTabKey =
| 'full-project-search'
| 'workbench'
export type RailModalKey = 'keyboard-shortcuts' | 'contact-us' | 'dictionary'
export type RailModalKey =
| 'keyboard-shortcuts'
| 'contact-us'
| 'dictionary'
| 'labs'
export function dispatchOpenRailModal(key: RailModalKey) {
window.dispatchEvent(new CustomEvent('ui:open-rail-modal', { detail: key }))
}
const RailContext = createContext<
| {
@@ -119,6 +127,16 @@ export const RailProvider: FC<React.PropsWithChildren> = ({ children }) => {
}, [handlePaneCollapse, selectedTab, isOpen, openTab])
)
useEventListener(
'ui:open-rail-modal',
useCallback(
(event: Event) => {
setActiveModal((event as CustomEvent<RailModalKey>).detail)
},
[setActiveModal]
)
)
useEventListener(
'keydown',
useCallback(