🎨 feat: UI Refresh for Enhanced UX (#6346)

*  feat: Add Expand Chat functionality and improve UI components

*  feat: Introduce Chat Badges feature with editing capabilities and UI enhancements

*  feat: re-implement file attachment functionality with new components and improved UI

*  feat: Enhance BadgeRow component with drag-and-drop functionality and add animations for better user experience

*  feat: Add useChatBadges hook and enhance Badge component with animations and toggle functionality

* feat: Improve Add/Delete Badges + style and bug fixes

*  feat: Refactor EditBadges component and optimize useChatBadges hook for improved performance and readability

*  feat: Add type definition for LucideIcon in EditBadges component

* refactor: Clean up BadgeRow component by removing outdated comment and improving code readability

* refactor: Rename app-icon class to badge-icon for consistency and improve badge styling

* feat: Add Center Chat Input toggle and update related components for improved UI/UX

* refactor: Simplify ChatView and MessagesView components for improved readability and performance

* refactor: Improve layout and positioning of scroll button in MessagesView component

* refactor: Adjust scroll button position in MessagesView component for better visibility

* refactor: Remove redundant background class from Badge component for cleaner styling

* feat: disable chat badges

* refactor: adjust positioning of scroll button and popover for improved layout

* refactor: simplify class names in ChatForm and RemoveFile components for cleaner code

* refactor: move Switcher to HeaderOptions from SidePanel

* fix(Landing): duplicate description

* feat: add SplitText component for animated text display and update Landing component to use it

* feat(Chat): add ConversationStarters component and integrate it into ChatView; remove ConvoStarter component

* feat(Chat): enhance Message component layout and styling for improved readability

* feat(ControlCombobox, Select): enhance styling and add animation for improved UI experience

* feat(Chat): update Header and HeaderNewChat components for improved layout and styling

* feat(Chat): add ModelDropdown (now includes both endpoint and model) and refactor Menu components for improved UI

* feat(ModelDropdown): add Agent Select; removed old AgentSwitcher components

* feat(ModelDropdown): add settings button for user key configuration

* fix(ModelDropdown): the model dropdown wasn't opening automatically when opening the endpoint one

* refactor(Chat): remove unused EndpointsMenu and related components to streamline codebase

* feat: enhance greeting message and improve accessibility fro ModelDropdown

* refactor(Endpoints): add new hooks and components for endpoint management

* feat(Endpoint): add support for modelSpecs

* feat(Endpoints): add mobile support

* fix: type issues

* fix(modelSpec): type issue

* fix(EndpointMenuDropdown): double overflow scroller in mobile model list

* fix: search model on mobile

* refactor: Endpoint/Model/modelSpec dropdown

* refactor: reorganize imports in Endpoint components

* refactor: remove unused translation keys from English locale

* BREAKING: moving to ariakit with new CustomMenu

* refactor: remove unnecessary comments

* refactor: remove EndpointItem, ModelDropdownButton, SpecIcon, and SpecItem components

* 🔧 fix: AI Icon bump when regenerating message

* wip: chat UI refactoring, fix issues

* chore: add recent update to useAutoSave

* feat: add access control for agent permissions in useMentions hook

* refactor: streamline ModelSelector by removing unused endpoints logic

* refactor: enhance ModelSelector and context by integrating endpointsConfig and improving type usage

* feat: update ModelSelectorContext to utilize conversation data for initial state

* feat: add selector effects for synced endpoint handling

* feat: add guard clause for conversation endpoint in useSelectorEffects hook

* fix: safely call onSelectMention and add autofocus to mention input

* chore: typing

* refactor: ModelSelector to streamline key dialog handling and improve endpoint rendering

* refactor: extract SettingsButton component for cleaner endpoint item rendering

* wip: first pass, expand set api key

* wip: first pass, expanding set key

* refactor: update EndpointItem styles for improved layout and hover effects

* refactor: adjust padding in EndpointItem for improved layout consistency

* refactor: update preset structure in useSelectMention to include spec as null

* refactor: rename setKeyDialogOpen to onOpenChange for clarity and consistency, bring focus back to button that opened dialog

* feat: add SpecIcon component for dynamic model spec icons in menu, adjust icon styling

* refactor: update getSelectedIcon to accept additional parameters and improve icon rendering logic

* fix: adjust padding in MessageRender for improved layout

* refactor: remove inline style for menu width in CustomMenu component

* refactor: enhance layout and styling in ModelSpecItem component for better responsiveness

* refactor: update getDefaultModelSpec to accept startupConfig and improve model spec retrieval logic

* refactor: improve key management and default values in ModelSelector and related components

* refactor: adjust menu width and improve responsiveness in CustomMenu and EndpointItem components

* refactor: enhance focus styles and responsiveness in EndpointItem component

* refactor: improve layout and spacing in Header and ModelSelector components for better responsiveness

* refactor: adjust button styles for consistency and improved layout in AddMultiConvo and PresetsMenu components

* fix: initial fix of assistant names

* fix: assistants handling

* chore: update version of librechat-data-provider to 0.7.75 and add 'spec' to excludedKeys

* fix: improve endpoint filtering logic based on interface configuration and access rights

* fix: remove unused HeaderOptions import and set spec to null in presets and mentions

* fix: ensure currentExample is always an object when updating examples

* fix: update interfaceConfig checks to ensure modelSelect is considered for rendering components

* fix: update model selection logic to consider interface configuration when prioritizing model specs

* fix: add missing localizations

* fix: remove unused agent and assistant selection translations

* fix: implement debounced state updates for selected values in useSelectorEffects

* style: minor style changes related to the ModelSelector

* fix: adjust maximum height for popover and set fixed height for model item

* fix: update placeholders for model and endpoint search inputs

* fix: refactor MessageRender and ContentRender components to better match each other

* fix: remove convo fallback for iconURL in MessageRender and ContentRender components

* fix: update handling of spec, iconURL, and modelLabel in conversation presets, to allow better interchangeability

* fix: replace chatGptLabel with modelLabel in OpenAI settings configuration (fully deprecate chatGptLabel)

* fix: remove console log for assistantNames in useEndpoints hook

* refactor: add cleanInput and cleanOutput options to default conversation handling

* chore: update bun.lockb

* fix: set default value for showIconInHeader in getSelectedIcon function

* refactor: enhance error handling in message processing when latest message has existing content blocks

* chore: allow import/no-cycle for messages

* fix: adjust flex properties in BookmarkMenu for better layout

* feat: support both 'prompt' and 'q' as query parameters in useQueryParams hook

* feat: re-enable Badges components

* refactor: disable edit badge component

* chore: rename assistantMap to assistantsMap for consistency

* chore: rename assistantMap to assistantsMap for consistency in Mention component

* feat: set staleTime for various queries to improve data freshness

* feat: add spec field to tQueryParamsSchema for model specification

* feat: enhance useQueryParams to handle model specs

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
Marco Beretta 2025-03-25 23:50:58 +01:00 committed by GitHub
parent c4fea9cd79
commit 7f29f2f676
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
127 changed files with 4507 additions and 2163 deletions

View file

@ -67,7 +67,7 @@ html {
--surface-primary-alt: var(--gray-50);
--surface-primary-contrast: var(--gray-100);
--surface-secondary: var(--gray-50);
--surface-secondary-alt: var(--gray-300);
--surface-secondary-alt: var(--gray-200);
--surface-tertiary: var(--gray-100);
--surface-tertiary-alt: var(--white);
--surface-dialog: var(--white);
@ -75,6 +75,7 @@ html {
--surface-submit-hover: var(--green-800);
--surface-destructive: var(--red-700);
--surface-destructive-hover: var(--red-800);
--surface-chat: var(--white);
--border-light: var(--gray-200);
--border-medium-alt: var(--gray-300);
--border-medium: var(--gray-300);
@ -132,6 +133,7 @@ html {
--surface-submit-hover: var(--green-800);
--surface-destructive: var(--red-800);
--surface-destructive-hover: var(--red-900);
--surface-chat: var(--gray-700);
--border-light: var(--gray-700);
--border-medium-alt: var(--gray-600);
--border-medium: var(--gray-600);
@ -624,25 +626,127 @@ pre {
margin: 0;
}
.scroll-down-enter {
.scroll-animation-enter {
opacity: 0;
transform: translateY(20px) scale(0.7) rotate(-5deg);
pointer-events: none;
}
/* .scroll-down-appear {
opacity: 0;
} */
.scroll-down-enter-active {
.scroll-animation-enter-done {
opacity: 1;
transition: opacity 400ms;
transform: translateY(0) scale(1);
}
.scroll-down-exit {
opacity: 1;
.scroll-animation-exit-done {
display: none;
}
.scroll-down-exit-active {
opacity: 0;
transition: opacity 400ms;
@keyframes twist-entrance {
0% {
transform: translateY(20px) scale(0.7) rotate(-5deg);
opacity: 0;
}
60% {
transform: translateY(2px) scale(0.95) rotate(2deg);
opacity: 0.9;
}
100% {
transform: translateY(0) scale(1) rotate(0deg);
opacity: 1;
}
}
.scroll-animation-enter-active {
animation: twist-entrance 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
transition-delay: 50ms;
}
@keyframes twist-exit {
0% {
transform: translateY(0) scale(1) rotate(0deg);
opacity: 1;
}
40% {
transform: translateY(5px) scale(0.95) rotate(2deg);
opacity: 0.7;
}
100% {
transform: translateY(20px) scale(0.7) rotate(-5deg);
opacity: 0;
}
}
.scroll-animation-exit-active {
animation: twist-exit 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
pointer-events: none;
}
.premium-scroll-button {
display: flex;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
padding: 0;
border-radius: 50%;
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.05),
0 4px 12px rgba(0, 0, 0, 0.08),
0 0 0 1px rgba(255, 255, 255, 0.08);
background-color: rgba(255, 255, 255, 0.9);
z-index: 10;
transition:
transform 500ms cubic-bezier(0.25, 0.1, 0.25, 1),
box-shadow 500ms cubic-bezier(0.25, 0.1, 0.25, 1);
overflow: hidden;
}
.dark .premium-scroll-button {
box-shadow:
0 2px 8px rgba(0, 0, 0, 0.2),
0 4px 12px rgba(0, 0, 0, 0.25),
0 0 0 1px rgba(255, 255, 255, 0.06);
background-color: rgba(35, 35, 40, 0.9);
}
.scroll-animation-enter-active .premium-scroll-button {
pointer-events: none !important;
}
.premium-scroll-button:hover:not(:active) {
transform: translateY(-1.5px) scale(1.02);
box-shadow:
0 5px 10px rgba(0, 0, 0, 0.07),
0 7px 14px rgba(0, 0, 0, 0.1),
0 0 0 1px rgba(255, 255, 255, 0.1);
}
.premium-scroll-button:active {
transform: translateY(1px) scale(0.98);
transition: all 150ms cubic-bezier(0.2, 0, 0.2, 1);
box-shadow:
0 1px 4px rgba(0, 0, 0, 0.1),
0 2px 8px rgba(0, 0, 0, 0.08),
0 0 0 1px rgba(255, 255, 255, 0.08);
}
@keyframes float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-1px);
}
}
.scroll-animation-enter-done .premium-scroll-button {
animation: float 2s ease-in-out infinite;
}
.premium-scroll-button:hover,
.premium-scroll-button:active {
animation: none;
}
.blink {
@ -749,7 +853,7 @@ pre {
margin-bottom: 1.6em;
margin-top: 1.6em;
padding-left: 1em;
quotes: '\201C''\201D''\2018''\2019';
quotes: '\201C' '\201D' '\2018' '\2019';
}
.prose :where(blockquote p:first-of-type):not(:where([class~='not-prose'] *)):before {
content: open-quote;
@ -1099,7 +1203,13 @@ pre {
code,
pre {
font-family: Consolas, Söhne Mono, Monaco, Andale Mono, Ubuntu Mono, monospace !important;
font-family:
Consolas,
Söhne Mono,
Monaco,
Andale Mono,
Ubuntu Mono,
monospace !important;
}
code[class='language-plaintext'] {
white-space: pre-line;
@ -1225,8 +1335,12 @@ button {
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width))
var(--tw-ring-color);
--tw-ring-offset-width: 2px;
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 transparent;
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 transparent);
box-shadow:
var(--tw-ring-offset-shadow),
var(--tw-ring-shadow),
0 0 transparent;
box-shadow:
var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 transparent);
}
.btn-primary.focus-visible {
--tw-ring-opacity: 1;
@ -1693,9 +1807,7 @@ html {
.tooltip-label:before {
content: attr(data-content);
}
button.scroll-convo {
display: none;
}
@-webkit-keyframes blink {
to {
visibility: hidden;
@ -1741,7 +1853,9 @@ button.scroll-convo {
animation: toast-close 0.12s cubic-bezier(0.4, 0, 1, 1) both;
}
.toast-root .alert-root {
box-shadow: 0 0 1px rgba(67, 90, 111, 0.3), 0 5px 8px -4px rgba(67, 90, 111, 0.3);
box-shadow:
0 0 1px rgba(67, 90, 111, 0.3),
0 5px 8px -4px rgba(67, 90, 111, 0.3);
flex-shrink: 0;
pointer-events: all;
}
@ -1846,8 +1960,12 @@ button.scroll-convo {
}
.dark .shadow-stroke:after,
.shadow-stroke:after {
box-shadow: 0 0 transparent, 0 0 transparent, var(--tw-shadow);
box-shadow: var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent),
box-shadow:
0 0 transparent,
0 0 transparent,
var(--tw-shadow);
box-shadow:
var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent),
var(--tw-shadow);
}
.dark .shadow-stroke:after {
@ -1869,8 +1987,12 @@ button.scroll-convo {
position: absolute;
right: 0;
top: 0;
box-shadow: 0 0 transparent, 0 0 transparent, var(--tw-shadow);
box-shadow: var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent),
box-shadow:
0 0 transparent,
0 0 transparent,
var(--tw-shadow);
box-shadow:
var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent),
var(--tw-shadow);
}
@ -1885,8 +2007,17 @@ button.scroll-convo {
content: '⬤';
width: 12px;
height: 12px;
font-family: system-ui, Inter, Söhne Circle, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
Noto Sans, sans-serif;
font-family:
system-ui,
Inter,
Söhne Circle,
-apple-system,
Segoe UI,
Roboto,
Ubuntu,
Cantarell,
Noto Sans,
sans-serif;
line-height: normal;
margin-left: 0.25rem;
vertical-align: middle;
@ -1896,8 +2027,17 @@ button.scroll-convo {
@supports (selector(:has(*))) {
.result-streaming > :is(ul, ol):last-child > li:last-child:not(:has(> :is(ul, ol, pre))):after {
content: '⬤';
font-family: system-ui, Inter, Söhne Circle, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
Noto Sans, sans-serif;
font-family:
system-ui,
Inter,
Söhne Circle,
-apple-system,
Segoe UI,
Roboto,
Ubuntu,
Cantarell,
Noto Sans,
sans-serif;
line-height: normal;
margin-left: 0.25rem;
vertical-align: middle;
@ -1912,8 +2052,17 @@ button.scroll-convo {
.result-streaming > ol:last-child > li:last-child:after,
.result-streaming > ul:last-child > li:last-child:after {
content: '⬤';
font-family: system-ui, Inter, Söhne Circle, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
Noto Sans, sans-serif;
font-family:
system-ui,
Inter,
Söhne Circle,
-apple-system,
Segoe UI,
Roboto,
Ubuntu,
Cantarell,
Noto Sans,
sans-serif;
line-height: normal;
margin-left: 0.25rem;
vertical-align: middle;
@ -2373,7 +2522,9 @@ button.scroll-convo {
background-color: hsl(var(--background));
padding: 0.5rem;
color: var(--text-primary);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
box-shadow:
0 10px 15px -3px rgb(0 0 0 / 0.1),
0 4px 6px -4px rgb(0 0 0 / 0.1);
transform-origin: top;
opacity: 0;
transition-property: opacity, scale, translate;
@ -2394,7 +2545,9 @@ button.scroll-convo {
.popover-ui:where(.dark, .dark *) {
background-color: hsl(var(--secondary));
color: var(--text-secondary);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.25), 0 4px 6px -4px rgb(0 0 0 / 0.1);
box-shadow:
0 10px 15px -3px rgb(0 0 0 / 0.25),
0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.select-item {
@ -2423,6 +2576,30 @@ button.scroll-convo {
translate: 0;
}
.animate-popover {
transform-origin: top;
opacity: 0;
transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
transform: scale(0.95) translateY(-0.5rem);
}
.animate-popover[data-enter] {
opacity: 1;
transform: scale(1) translateY(0);
}
.animate-popover-left {
transform-origin: left;
opacity: 0;
transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
transform: scale(0.95) translateX(-0.5rem);
}
.animate-popover-left[data-enter] {
opacity: 1;
transform: scale(1) translateX(0);
}
/** Note: ensure KaTeX can spread across visible space */
.message-content pre:has(> span.katex) {
overflow: visible !important;
@ -2474,3 +2651,31 @@ button.scroll-convo {
.scale-98 {
transform: scale(0.98);
}
/* Chat Badges Animation */
@keyframes ios-wiggle {
0% {
transform: rotate(-1deg);
}
50% {
transform: rotate(1deg);
}
100% {
transform: rotate(-1deg);
}
}
.ios-wiggle {
animation: ios-wiggle 0.2s ease-in-out infinite;
}
.ghost-badge {
transition:
left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.badge-icon {
transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}