add right click to bases and fix copy path

This commit is contained in:
Arjun 2026-04-01 10:42:48 +05:30
parent 7a425acfdf
commit 54af172cbc
2 changed files with 146 additions and 18 deletions

View file

@ -3410,7 +3410,14 @@ function App() {
},
copyPath: (path: string) => {
const fullPath = workspaceRoot ? `${workspaceRoot}/${path}` : path
navigator.clipboard.writeText(fullPath)
navigator.clipboard.writeText(fullPath).catch(() => {
const textarea = document.createElement('textarea')
textarea.value = fullPath
document.body.appendChild(textarea)
textarea.select()
document.execCommand('copy')
document.body.removeChild(textarea)
})
},
onOpenInNewTab: (path: string) => {
openFileInNewTab(path)
@ -4122,6 +4129,11 @@ function App() {
onSave={(name) => void handleBaseSave(name)}
externalSearch={externalBaseSearch}
onExternalSearchConsumed={() => setExternalBaseSearch(undefined)}
actions={{
rename: knowledgeActions.rename,
remove: knowledgeActions.remove,
copyPath: knowledgeActions.copyPath,
}}
/>
</div>
) : isGraphOpen ? (