Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: revamp thread screen #802

Merged
merged 27 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
27fff88
Make thread screen as default screen
urmauur Nov 29, 2023
599dbd4
Blank state when user have not any model
urmauur Nov 29, 2023
f2fc103
Cleanup topbar thread screen
urmauur Nov 30, 2023
d00a3a7
Improve style right panel
urmauur Dec 1, 2023
24a6b7b
Add instructions right panel
urmauur Dec 1, 2023
c7f211c
Styling thread list history
urmauur Dec 1, 2023
cf46ff0
Resolve conflict
urmauur Dec 2, 2023
2ca5007
Default title new thread
urmauur Dec 2, 2023
1d826e0
Fix trigger panel sidebar
urmauur Dec 2, 2023
a0ebf87
Make default right panel false when no activethread
urmauur Dec 2, 2023
2c105f4
Fix CI test
urmauur Dec 2, 2023
c42c37a
chore: assistant instruction with system prompt
louis-jan Dec 2, 2023
cc4a05c
Fix title and blank state explore the hub
urmauur Dec 2, 2023
a8d1d0f
Claenup style thread screen and add buble message for assitant
urmauur Dec 2, 2023
2fe6690
Remove unused import
urmauur Dec 2, 2023
c63bb69
Styling more menus on thread list and right panel, and make max heigh…
urmauur Dec 2, 2023
74cddd4
Finished revamp ui thread
urmauur Dec 2, 2023
0ea19d4
Finished system monitor UI
urmauur Dec 2, 2023
4396b05
Style box running models
urmauur Dec 2, 2023
5019676
Make animate right panel more smooth
urmauur Dec 3, 2023
ad992f6
Add status arround textarea for starting model info
urmauur Dec 3, 2023
5f8678e
Temporary disable hide left panel
urmauur Dec 3, 2023
3254bf3
chore: system resource monitoring update
louis-jan Dec 3, 2023
b5795cd
copy nits
Dec 3, 2023
aa0404c
chore: typo
louis-jan Dec 3, 2023
159b4c9
Reverse icon chevron accordion
urmauur Dec 3, 2023
0074f40
Move my models into setting page
urmauur Dec 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export type ThreadAssistantInfo = {
assistant_id: string;
assistant_name: string;
model: ModelInfo;
instructions?: string;
};

/**
Expand Down Expand Up @@ -288,13 +289,13 @@ export type Assistant = {
/** Represents the name of the object. */
name: string;
/** Represents the description of the object. */
description: string;
description?: string;
/** Represents the model of the object. */
model: string;
/** Represents the instructions for the object. */
instructions: string;
instructions?: string;
/** Represents the tools associated with the object. */
tools: any;
tools?: any;
/** Represents the file identifiers associated with the object. */
file_ids: string[];
/** Represents the metadata of the object. */
Expand Down
18 changes: 9 additions & 9 deletions electron/managers/window.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { BrowserWindow } from "electron";
import { BrowserWindow } from 'electron'

/**
* Manages the current window instance.
*/
export class WindowManager {
public static instance: WindowManager = new WindowManager();
public currentWindow?: BrowserWindow;
public static instance: WindowManager = new WindowManager()
public currentWindow?: BrowserWindow

constructor() {
if (WindowManager.instance) {
return WindowManager.instance;
return WindowManager.instance
}
}

Expand All @@ -21,17 +21,17 @@ export class WindowManager {
createWindow(options?: Electron.BrowserWindowConstructorOptions | undefined) {
this.currentWindow = new BrowserWindow({
width: 1200,
minWidth: 800,
minWidth: 1200,
height: 800,
show: false,
trafficLightPosition: {
x: 10,
y: 15,
},
titleBarStyle: "hidden",
vibrancy: "sidebar",
titleBarStyle: 'hidden',
vibrancy: 'sidebar',
...options,
});
return this.currentWindow;
})
return this.currentWindow
}
}
42 changes: 21 additions & 21 deletions electron/tests/explore.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import { _electron as electron } from "playwright";
import { ElectronApplication, Page, expect, test } from "@playwright/test";
import { _electron as electron } from 'playwright'
import { ElectronApplication, Page, expect, test } from '@playwright/test'

import {
findLatestBuild,
parseElectronApp,
stubDialog,
} from "electron-playwright-helpers";
} from 'electron-playwright-helpers'

let electronApp: ElectronApplication;
let page: Page;
let electronApp: ElectronApplication
let page: Page

test.beforeAll(async () => {
process.env.CI = "e2e";
process.env.CI = 'e2e'

const latestBuild = findLatestBuild("dist");
expect(latestBuild).toBeTruthy();
const latestBuild = findLatestBuild('dist')
expect(latestBuild).toBeTruthy()

// parse the packaged Electron app and find paths and other info
const appInfo = parseElectronApp(latestBuild);
expect(appInfo).toBeTruthy();
const appInfo = parseElectronApp(latestBuild)
expect(appInfo).toBeTruthy()

electronApp = await electron.launch({
args: [appInfo.main], // main file from package.json
executablePath: appInfo.executable, // path to the Electron executable
});
await stubDialog(electronApp, "showMessageBox", { response: 1 });
})
await stubDialog(electronApp, 'showMessageBox', { response: 1 })

page = await electronApp.firstWindow();
});
page = await electronApp.firstWindow()
})

test.afterAll(async () => {
await electronApp.close();
await page.close();
});
await electronApp.close()
await page.close()
})

test("explores models", async () => {
await page.getByTestId("Explore Models").first().click();
await page.getByTestId("testid-explore-models").isVisible();
test('explores models', async () => {
await page.getByTestId('Hub').first().click()
await page.getByTestId('testid-explore-models').isVisible()
// More test cases here...
});
})
64 changes: 32 additions & 32 deletions electron/tests/main.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
import { _electron as electron } from "playwright";
import { ElectronApplication, Page, expect, test } from "@playwright/test";
import { _electron as electron } from 'playwright'
import { ElectronApplication, Page, expect, test } from '@playwright/test'

import {
findLatestBuild,
parseElectronApp,
stubDialog,
} from "electron-playwright-helpers";
} from 'electron-playwright-helpers'

let electronApp: ElectronApplication;
let page: Page;
let electronApp: ElectronApplication
let page: Page

test.beforeAll(async () => {
process.env.CI = "e2e";
process.env.CI = 'e2e'

const latestBuild = findLatestBuild("dist");
expect(latestBuild).toBeTruthy();
const latestBuild = findLatestBuild('dist')
expect(latestBuild).toBeTruthy()

// parse the packaged Electron app and find paths and other info
const appInfo = parseElectronApp(latestBuild);
expect(appInfo).toBeTruthy();
expect(appInfo.asar).toBe(true);
expect(appInfo.executable).toBeTruthy();
expect(appInfo.main).toBeTruthy();
expect(appInfo.name).toBe("jan");
expect(appInfo.packageJson).toBeTruthy();
expect(appInfo.packageJson.name).toBe("jan");
expect(appInfo.platform).toBeTruthy();
expect(appInfo.platform).toBe(process.platform);
expect(appInfo.resourcesDir).toBeTruthy();
const appInfo = parseElectronApp(latestBuild)
expect(appInfo).toBeTruthy()
expect(appInfo.asar).toBe(true)
expect(appInfo.executable).toBeTruthy()
expect(appInfo.main).toBeTruthy()
expect(appInfo.name).toBe('jan')
expect(appInfo.packageJson).toBeTruthy()
expect(appInfo.packageJson.name).toBe('jan')
expect(appInfo.platform).toBeTruthy()
expect(appInfo.platform).toBe(process.platform)
expect(appInfo.resourcesDir).toBeTruthy()

electronApp = await electron.launch({
args: [appInfo.main], // main file from package.json
executablePath: appInfo.executable, // path to the Electron executable
});
await stubDialog(electronApp, "showMessageBox", { response: 1 });
})
await stubDialog(electronApp, 'showMessageBox', { response: 1 })

page = await electronApp.firstWindow();
});
page = await electronApp.firstWindow()
})

test.afterAll(async () => {
await electronApp.close();
await page.close();
});
await electronApp.close()
await page.close()
})

test("renders the home page", async () => {
expect(page).toBeDefined();
test('renders the home page', async () => {
expect(page).toBeDefined()

// Welcome text is available
const welcomeText = await page
.getByTestId("testid-welcome-title")
.getByTestId('testid-welcome-title')
.first()
.isVisible();
expect(welcomeText).toBe(false);
});
.isVisible()
expect(welcomeText).toBe(false)
})
41 changes: 0 additions & 41 deletions electron/tests/my-models.e2e.spec.ts

This file was deleted.

51 changes: 27 additions & 24 deletions electron/tests/navigation.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,51 +1,54 @@
import { _electron as electron } from "playwright";
import { ElectronApplication, Page, expect, test } from "@playwright/test";
import { _electron as electron } from 'playwright'
import { ElectronApplication, Page, expect, test } from '@playwright/test'

import {
findLatestBuild,
parseElectronApp,
stubDialog,
} from "electron-playwright-helpers";
} from 'electron-playwright-helpers'

let electronApp: ElectronApplication;
let page: Page;
let electronApp: ElectronApplication
let page: Page

test.beforeAll(async () => {
process.env.CI = "e2e";
process.env.CI = 'e2e'

const latestBuild = findLatestBuild("dist");
expect(latestBuild).toBeTruthy();
const latestBuild = findLatestBuild('dist')
expect(latestBuild).toBeTruthy()

// parse the packaged Electron app and find paths and other info
const appInfo = parseElectronApp(latestBuild);
expect(appInfo).toBeTruthy();
const appInfo = parseElectronApp(latestBuild)
expect(appInfo).toBeTruthy()

electronApp = await electron.launch({
args: [appInfo.main], // main file from package.json
executablePath: appInfo.executable, // path to the Electron executable
});
await stubDialog(electronApp, "showMessageBox", { response: 1 });
})
await stubDialog(electronApp, 'showMessageBox', { response: 1 })

page = await electronApp.firstWindow();
});
page = await electronApp.firstWindow()
})

test.afterAll(async () => {
await electronApp.close();
await page.close();
});
await electronApp.close()
await page.close()
})

test("renders left navigation panel", async () => {
test('renders left navigation panel', async () => {
// Chat section should be there
const chatSection = await page.getByTestId("Chat").first().isVisible();
expect(chatSection).toBe(false);
const chatSection = await page.getByTestId('Chat').first().isVisible()
expect(chatSection).toBe(false)

// Home actions
/* Disable unstable feature tests
** const botBtn = await page.getByTestId("Bot").first().isEnabled();
** Enable back when it is whitelisted
*/

const myModelsBtn = await page.getByTestId("My Models").first().isEnabled();
const settingsBtn = await page.getByTestId("Settings").first().isEnabled();
expect([myModelsBtn, settingsBtn].filter((e) => !e).length).toBe(0);
});
const systemMonitorBtn = await page
.getByTestId('System Monitor')
.first()
.isEnabled()
const settingsBtn = await page.getByTestId('Settings').first().isEnabled()
expect([systemMonitorBtn, settingsBtn].filter((e) => !e).length).toBe(0)
})
Loading
Loading