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 laggy typing experience in prompt field for longer chats #108

Open
itsmartashub opened this issue Mar 1, 2025 · 0 comments
Open

Fix laggy typing experience in prompt field for longer chats #108

itsmartashub opened this issue Mar 1, 2025 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@itsmartashub
Copy link
Owner

itsmartashub commented Mar 1, 2025

Currently, when the chat becomes lengthy, the typing experience in the prompt field becomes significantly laggy.

The problem does not replicate without the extension, indicating that the issue originates from the extension's interaction with the chat interface.

The issue arose due to the use of the :has() CSS pseudo-class targeting the main element (main:has(#composer-background)). This selector caused performance overhead, leading to a laggy typing experience in the chat prompt field. The :has() selector is used to select an element based on the presence of a specific descendant, which can introduce frequent and unnecessary checks by the browser, especially during interactions like typing.

To resolve the issue, simplifying the CSS selector by removing the :has() part and directly targeting main proved effective. This change eliminate the performance bottleneck, restoring smooth typing.

This situation highlights the importance of optimizing CSS selectors, particularly in extensions, to avoid performance issues. It underscores the need to use simpler selectors or alternative methods to achieve the desired styling without compromising performance.
So that being said, future development should focus on simplifying selectors and exploring efficient selection techniques to prevent similar issues.

@itsmartashub itsmartashub added the Bug Something isn't working label Mar 1, 2025
@itsmartashub itsmartashub self-assigned this Mar 1, 2025
itsmartashub added a commit that referenced this issue Mar 1, 2025
- Fix laggy typing experience in prompt field for longer chats by replacing CSS `:has()` usage
- Improve performance related to GPThems Customization tabs and theme rendering

Changes summary:
Resolved laggy typing in the prompt field for longer chats and enhanced overall performance for GPThems Customization tabs and theme interactions.
@itsmartashub itsmartashub added the Status: WIP Work In Progress label Mar 1, 2025
itsmartashub added a commit that referenced this issue Mar 3, 2025
…ns (#108)

- Fix laggy typing experience on smaller screens by optimizing layout calculations
- Reposition floating button to prevent overlap with the "New Chat" button on the main page and the user profile image on the GPTs page

Changes summary:
Resolved typing lag on smaller screens and repositioned the floating button to avoid overlapping with the "New Chat" button and user profile image.
@itsmartashub itsmartashub added Status: Already Implemented A proposal which has already been implemented before and removed Status: WIP Work In Progress Status: Already Implemented A proposal which has already been implemented before labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant