(input: {
normalizeTab: (tab: string) => string
openTab: (tab: string) => void
pathFromTab: (tab: string) => string | undefined
loadFile: (path: string) => void
openReviewPanel: () => void
setActive: (tab: string) => void
})
| 128 | } |
| 129 | |
| 130 | export const createOpenSessionFileTab = (input: { |
| 131 | normalizeTab: (tab: string) => string |
| 132 | openTab: (tab: string) => void |
| 133 | pathFromTab: (tab: string) => string | undefined |
| 134 | loadFile: (path: string) => void |
| 135 | openReviewPanel: () => void |
| 136 | setActive: (tab: string) => void |
| 137 | }) => { |
| 138 | return (value: string) => { |
| 139 | const next = input.normalizeTab(value) |
| 140 | input.openTab(next) |
| 141 | |
| 142 | const path = input.pathFromTab(next) |
| 143 | if (!path) return |
| 144 | |
| 145 | input.loadFile(path) |
| 146 | input.openReviewPanel() |
| 147 | input.setActive(next) |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | export const getTabReorderIndex = (tabs: readonly string[], from: string, to: string) => { |
| 152 | const fromIndex = tabs.indexOf(from) |
no outgoing calls
no test coverage detected