minor updates trying to get it to build

This commit is contained in:
Andrew Pareles 2024-11-14 01:29:54 -08:00
parent bd49aaffde
commit 047cc03002
8 changed files with 28 additions and 72 deletions

View file

@ -7,6 +7,7 @@ import { useSidebarState } from '../util/contextForServices.js';
// import { SidebarChat } from './SidebarChat.js';
import '../styles.css'
import { SidebarThreadSelector } from './SidebarThreadSelector.js';
const Sidebar = () => {
const [sidebarState, sidebarStateService] = useSidebarState()
@ -15,18 +16,18 @@ const Sidebar = () => {
return <div className='@@void-scope'>
<div className={`flex flex-col h-screen w-full`}>
<span onClick={() => {
{/* <span onClick={() => {
const tabs = ['chat', 'settings', 'threadSelector']
const index = tabs.indexOf(tab)
sidebarStateService.setState({ currentTab: tabs[(index + 1) % tabs.length] as any })
}}>clickme {tab}</span>
}}>clickme {tab}</span> */}
<div className={`mb-2 h-[30vh] ${isHistoryOpen ? '' : 'hidden'}`}>
{/* <SidebarThreadSelector onClose={() => setTab('chat')} /> */}
<SidebarThreadSelector />
</div>
<div className={`${tab === 'chat' ? '' : 'hidden'}`}>
{/* <SidebarChat chatInputRef={chatInputRef} /> */}
{/* <SidebarChat /> */}
</div>
<div className={`${tab === 'settings' ? '' : 'hidden'}`}>

View file

@ -111,7 +111,9 @@ const ChatBubble = ({ chatMessage }: { chatMessage: ChatMessage }) => {
export const SidebarChat = ({ chatInputRef }: { chatInputRef: React.RefObject<HTMLTextAreaElement> }) => {
export const SidebarChat = () => {
const chatInputRef = useRef<HTMLTextAreaElement | null>(null)
const fileService = useService('fileService')

View file

@ -1,5 +1,5 @@
import React from "react";
import { useThreadsState } from '../util/contextForServices.js';
import { useSidebarState, useThreadsState } from '../util/contextForServices.js';
const truncate = (s: string) => {
@ -11,9 +11,11 @@ const truncate = (s: string) => {
}
export const SidebarThreadSelector = ({ onClose }: { onClose: () => void }) => {
export const SidebarThreadSelector = () => {
const [threadsState, threadsStateService] = useThreadsState()
const [sidebarState, sidebarStateService] = useSidebarState()
const { allThreads } = threadsState
// sorted by most recent to least recent
@ -24,7 +26,7 @@ export const SidebarThreadSelector = ({ onClose }: { onClose: () => void }) => {
{/* X button at top right */}
<div className="text-right">
<button className="btn btn-sm" onClick={onClose}>
<button className="btn btn-sm" onClick={() => sidebarStateService.setState({ isHistoryOpen: false })}>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"

View file

@ -6,6 +6,7 @@
"esModuleInterop": true,
},
"include": [
// this is just for type checking, so src/ is the correct dir
"./src/**/*.ts",
"./src/**/*.tsx"
]

View file

@ -8,7 +8,7 @@ export default defineConfig({
],
outDir: './out',
format: ['esm'],
dts: true,
// dts: true,
splitting: false,
// sourcemap: true,
clean: true,

View file

@ -9,7 +9,7 @@ interface IMetricsService {
readonly _serviceBrand: undefined;
}
const IMetricsService = createDecorator<IMetricsService>('inlineDiffService');
const IMetricsService = createDecorator<IMetricsService>('metricsService');
class MetricsService extends Disposable implements IMetricsService {
_serviceBrand: undefined;
@ -17,29 +17,16 @@ class MetricsService extends Disposable implements IMetricsService {
@ITelemetryService private readonly _telemetryService: ITelemetryService
) {
super()
}
init() {
posthog.init('phc_UanIdujHiLp55BkUTjB1AuBXcasVkdqRwgnwRlWESH2',
{
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only' // we only track events from identified users. We identify them in Sidebar
}
)
posthog.init('phc_UanIdujHiLp55BkUTjB1AuBXcasVkdqRwgnwRlWESH2', {
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only' // we only track events from identified users. We identify them in Sidebar
})
const deviceId = this._telemetryService.devDeviceId
console.debug('deviceId', deviceId)
posthog.identify(deviceId)
// export const captureEvent = (eventId: string, properties: object) => {
// posthog.capture(eventId, properties)
// }
}
}
registerSingleton(IMetricsService, MetricsService, InstantiationType.Eager);

View file

@ -108,46 +108,6 @@ class VoidSidebarViewPane extends ViewPane {
});
}
// private _renderChat(element: HTMLElement) {
// // useEffect(() => {
// // this._voidSidebarStateService.onDidChange(() => {
// // })
// // this._voidSidebarStateService.onFocusChat(() => {
// // })
// // this._voidSidebarStateService.onBlurChat(() => {
// // })
// // })
// }
// private _renderHistory(element: HTMLElement) {
// // <div className={`mb-2 h-[30vh] ${tab !== 'threadSelector' ? 'hidden' : ''}`}>
// // <SidebarThreadSelector onClose={() => setTab('chat')} />
// // </div>
// this._voidSidebarStateService.onDidChange(() => {
// })
// this._threadHistoryService.onDidChangeCurrentThread(() => {
// })
// }
// private _renderSettings(element: HTMLElement) {
// // <div className={`${tab !== 'settings' ? 'hidden' : ''}`}>
// // <SidebarSettings />
// // </div>
// }
}

View file

@ -1,11 +1,14 @@
// register Settings
// // register Settings
import './registerConfig.js'
// register Sidebar chat
// // register Sidebar chat
import './registerSidebar.js'
// register Posthog metrics
// // register Posthog metrics
import './registerMetrics.js'
// register Thread History
// // register Thread History
import './registerThreads.js'
// // register inline diffs
import './registerInlineDiffs.js'