Skip to content

Conversation

@josefbender
Copy link

Still work in progress

@christopherschaedlich christopherschaedlich changed the title Feature: add welcome screen WIP: Feature: add welcome screen Jun 18, 2025
Comment on lines +26 to +38
const [searchParams, setSearchParams] = useSearchParams();

const toCreate = searchParams.get('add-extension') === 'true';

const setToCreate = (value: boolean) => {
const newParams = new URLSearchParams(searchParams);
if (value) {
newParams.set('add-extension', 'true');
} else {
newParams.delete('add-extension');
}
setSearchParams(newParams);
};
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated code in ConfigurationPage und ExtensionPage.
I'm not 100% sure I understand what this code tries to accomplish. Isn't this basically redirect? Couldn't we simply use router.push(...)?

Copy link
Author

Choose a reason for hiding this comment

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

No, it's not a redirect: We are updating the url search parameter 'add-extension'.


const toCreate = searchParams.get('add-extension') === 'true';

const setToCreate = (value: boolean) => {
Copy link
Member

Choose a reason for hiding this comment

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

Given that this is a click handler, a name like handleSomeButtonClick might be more canonical.

queryKey: ['enabled-configurations'],
queryFn: () => api.extensions.getConfigurations(true),
});
if (!loadedConfigurations) return <></>;
Copy link
Member

Choose a reason for hiding this comment

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

Is the empty answer intended?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, we currently don't have a skeleton, we just show a blank page

Comment on lines 1 to 25
import { Button, Text, Title } from '@mantine/core';
import { IconArrowRight } from '@tabler/icons-react';
import { useProfile } from 'src/hooks';

export const WelcomePage = () => {
const profile = useProfile();
if (!profile) return <></>;
return (
<div className="flex h-screen items-center justify-center p-4">
<div className="max-w-[500px] [&>*]:pb-2">
<Title>Welcome to c4 GenAI Suite</Title>
<Text c="dimmed">An AI chatbot with Model Context Provider (MCP) integration. Powered by Langchain.</Text>
<br />
{profile.isAdmin ? (
<Button component="a" href="/admin/assistants?create=true" rightSection={<IconArrowRight className="w-4" />}>
Setup an Assistent
</Button>
) : (
<Text c="dimmed">No Assistent is set up yet. Ask your Admin to set up an Assistent get started.</Text>
)}
</div>
</div>
);
};
Copy link
Member

@marcusleg marcusleg Jun 20, 2025

Choose a reason for hiding this comment

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

Given how short this JSX is (short for JSX anyway), would it make sense to add this as an early return the ExtensionsPage, avoid all this indirection and extra layering and have one component instead of four?

The goal here seems to be displaying a default message when the Extensions page is empty.

Copy link
Author

Choose a reason for hiding this comment

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

No, this is actually shown in the user section. When no assistent exists, we show a welcome page

@josefbender josefbender force-pushed the feature/add-welcome-screen branch from f7a0312 to a4de045 Compare June 23, 2025 14:42
@josefbender
Copy link
Author

@marcusleg Could you please trigger the workflow for me?

@josefbender josefbender force-pushed the feature/add-welcome-screen branch from 1a80c29 to 05b400e Compare June 26, 2025 06:31
@josefbender
Copy link
Author

Updated PR: #69

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.

2 participants