🧹 chore: Remove Deprecated BingAI Code & Address Mobile Focus (#5565)

* chore: remove all bing code

* chore: remove bing code and auto-focus effects

* chore: add back escapeRegExp helper function for regex special character handling

* chore: remove deprecated fields from settings and conversation schema

* fix: ensure default endpoint is set correctly in conversation setup

* feat: add disableFocus option to newConversation for improved search behavior
This commit is contained in:
Danny Avila 2025-01-30 17:22:29 -05:00 committed by GitHub
parent 1226f56d0c
commit 19fa4d9f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 52 additions and 1384 deletions

View file

@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test';
test.describe('Settings suite', () => {
test('Last Bing settings', async ({ page }) => {
test('Last OpenAI settings', async ({ page }) => {
await page.goto('http://localhost:3080/', { timeout: 5000 });
await page.evaluate(() =>
window.localStorage.setItem(
@ -9,17 +9,9 @@ test.describe('Settings suite', () => {
JSON.stringify({
conversationId: 'new',
title: 'New Chat',
endpoint: 'bingAI',
endpoint: 'openAI',
createdAt: '',
updatedAt: '',
jailbreak: false,
context: null,
systemMessage: null,
toneStyle: 'creative',
jailbreakConversationId: null,
conversationSignature: null,
clientId: null,
invocationId: 1,
}),
),
);
@ -27,13 +19,13 @@ test.describe('Settings suite', () => {
const initialLocalStorage = await page.evaluate(() => window.localStorage);
const lastConvoSetup = JSON.parse(initialLocalStorage.lastConversationSetup);
expect(lastConvoSetup.endpoint).toEqual('bingAI');
expect(lastConvoSetup.endpoint).toEqual('openAI');
const newTopicButton = page.getByTestId('new-conversation-menu');
await newTopicButton.click();
// includes the icon + endpoint names in obj property
const endpointItem = page.getByTestId('endpoint-item-bingAI');
const endpointItem = page.getByTestId('endpoint-item-openAI');
await endpointItem.click();
await page.getByTestId('text-input').click();
@ -65,10 +57,6 @@ test.describe('Settings suite', () => {
// Check if the settings persisted
const localStorage = await page.evaluate(() => window.localStorage);
const lastBingSettings = JSON.parse(localStorage.lastBingSettings);
const { jailbreak, toneStyle } = lastBingSettings;
expect(jailbreak).toBeTruthy();
expect(toneStyle).toEqual('balanced');
const button = page.getByRole('button', { name: 'Mode: Sydney' });
expect(button.count()).toBeTruthy();
});