-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Allow UI configuration via environment variables #563
Conversation
@sarah-widder haven't tried it yet with Quart, but will rebase on main when #460 is merged and adapt to the new changes. Shouldn't be too difficult! Would you agree with the current proposal in this PR? I was hesitating to add a JSON based format, which can contain more branding options easily, but this might be too difficult for starting users. The current proposal is only to allow a few small changes. Customers can still change the code for more changes. |
bd8b6c9
to
2b12886
Compare
Rebased on main! My latest thought is that Perhaps we should prefix it with
|
@iMicknl that's a great point - let's use |
16f1169
to
a4b24b0
Compare
Rebased on |
I love the idea of this PR, and think the proposed implementation is both clean and user-friendly. However, I would like to see 1 more setting be added in order to set the favicon to a user-defined image. |
Hi @iMicknl - would you mind adding in the suggested setting for the Favicon? Otherwise this is looking great. |
1fe0769
to
a5ccde4
Compare
Done + rebased on main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work, thanks @iMicknl !
I think there is bug in favicon icon implementation, it doesnt update in the browser tab. |
Many customers like this accelerator / sample because it is easy to set up and very clean. However, many customers struggle with making small branding changes. Especially since the sample has been rebranded to use Contoso + logo's, the demand for branding has risen.
This pull request primarily introduces branding customization to the application. The changes allow users to customize the title, logo, chat title, and chat description by setting environment variables. The most significant changes include the addition of new environment variables in the
.env.sample
file, the modification of theapp.py
file to use these variables, and the adjustment of frontend components to use these new settings.Related discussions: #269, #438, #498,
Fixes #522
Fixes #553
Fixes #558
Fixes #277.
Preview:
Example configuration:
Screenshot:
Changes
The changes allow users to modify the title, logo, and descriptions of the chat application via environment variables. These changes affect the
.env.sample
,README.md
,app.py
,frontend/index.html
,frontend/src/api/models.ts
,frontend/src/pages/chat/Chat.module.css
,frontend/src/pages/chat/Chat.tsx
,frontend/src/pages/layout/Layout.module.css
, andfrontend/src/pages/layout/Layout.tsx
files.UI Customization:
.env.sample
: Added environment variables for UI customization includingUI_TITLE
,UI_LOGO
,UI_CHAT_LOGO
,UI_CHAT_TITLE
, andUI_CHAT_DESCRIPTION
.README.md
: Updated the documentation to reflect the new environment variables for UI customization and removed the section about updating the logo and headers in theChat.tsx
file. [1] [2] [3]app.py
: Imported therender_template
function and added new variables for the UI configuration. Theindex
function now usesrender_template
to render theindex.html
file with the title. Theassets
function includes the UI configuration in thefrontend_settings
. [1] [2] [3] [4]frontend/index.html
: Updated the title to use thetitle
variable.frontend/src/api/models.ts
: Added a newUI
type and updated theFrontendSettings
type to include theui
property.frontend/src/pages/chat/Chat.module.css
: Updated thechatIcon
class to have an auto width.frontend/src/pages/chat/Chat.tsx
: Updated the chat page to use the UI configuration from the frontend settings. The chat logo, title, and description are now customizable. [1] [2]frontend/src/pages/layout/Layout.module.css
: Updated theheaderIcon
class to have an auto width.frontend/src/pages/layout/Layout.tsx
: Updated the layout to use the UI configuration from the frontend settings. The logo and title in the header are now customizable. [1] [2]