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

fix: keep in history list after history deleted #26

Conversation

wanglam
Copy link
Collaborator

@wanglam wanglam commented Nov 30, 2023

Description

Same as #19

Fix jump to new chat page after current session deleted in dock right mode like below video:

Screen.Recording.2023-11-29.at.14.41.57.mov

It should stay the same page

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@wanglam wanglam marked this pull request as ready for review November 30, 2023 06:41
import { BehaviorSubject } from 'rxjs';
import { I18nProvider } from '@osd/i18n/react';

import * as useChatStateExports from '../../../hooks/use_chat_state';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: we should barrel this stuff in like

public/tabs/history/index.ts

and then export those files in there so that we can just import with a single line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that means we create a public/tabs/history/index.ts file and exports all references in it like these

export * from './../hooks/use_chat_state';
export *  from '../../../contexts/chat_context';

then we can import them in single line like this

import * as historyExports from "../";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah and i think if you need to import you can be like

import { useChatState } from '../history'

depending on where you are importing it. I would export * like how you are doing and then be specific.

Our build system is like a custom implementation of babel and webpack so importing everything with * could potentially not support tree-shaking. So just in general probably better to import what you need to ensure a smaller bundle size.

Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants