MCPcopy Index your code
hub / github.com/ChatGPTBox-dev/chatGPTBox / createSelectionTools

Function createSelectionTools

src/content-script/index.jsx:239–266  ·  view source on GitHub ↗
(toolbarContainerElement, selection)

Source from the content-addressed store, hash-verified

237}
238
239const createSelectionTools = async (toolbarContainerElement, selection) => {
240 console.debug(
241 '[content] createSelectionTools called with selection:',
242 selection,
243 'and container:',
244 toolbarContainerElement,
245 )
246 try {
247 toolbarContainerElement.className = 'chatgptbox-toolbar-container'
248 const userConfig = await getUserConfig()
249 render(
250 <FloatingToolbar
251 session={initSession({
252 modelName: userConfig.modelName,
253 apiMode: userConfig.apiMode,
254 extraCustomModelName: userConfig.customModelName,
255 })}
256 selection={selection}
257 container={toolbarContainerElement}
258 dockable={true}
259 />,
260 toolbarContainerElement,
261 )
262 console.log('[content] Selection tools rendered.')
263 } catch (error) {
264 console.error('[content] Error in createSelectionTools:', error)
265 }
266}
267
268let selectionToolsInitialized = false
269

Callers 2

prepareForSelectionToolsFunction · 0.85

Calls 2

getUserConfigFunction · 0.90
initSessionFunction · 0.90

Tested by

no test coverage detected