feat(onboarding): polish setup experience
This commit is contained in:
1 parent
f4891447d3
commit
4ca02a9133
34 files changed
+1005
-1172
No files matched your search
@@ -534,8 +534,8 @@ export const assistantRouter = createTRPCRouter({
|
||||
connectionConfigured: Boolean(configuration),
|
||||
enabled: configuration?.enabled ?? false,
|
||||
webSearchEnabled: configuration?.webSearchEnabled ?? false,
|
||||
provider: configuration?.provider ?? "openrouter",
|
||||
baseUrl: configuration?.baseUrl ?? "https://openrouter.ai/api/v1",
|
||||
provider: configuration?.provider ?? "homarr",
|
||||
baseUrl: configuration?.baseUrl ?? getHomarrProviderBaseUrl(),
|
||||
modelDiscoveryPath: configuration?.modelDiscoveryPath ?? "/models",
|
||||
apiKeyConfigured: Boolean(configuration?.encryptedApiKey),
|
||||
customHeadersConfigured: Boolean(configuration?.encryptedHeaders),
|
||||
|
||||
@@ -585,7 +585,7 @@ export const onboardRouter = createTRPCRouter({
|
||||
);
|
||||
let leftGutterColumnCount = requestedGutters.left;
|
||||
let rightGutterColumnCount = requestedGutters.right;
|
||||
const desiredColumns = getLayoutPresetColumnCount(input.board.layoutPreset);
|
||||
const desiredColumns = input.board.columnCount ?? getLayoutPresetColumnCount(input.board.layoutPreset);
|
||||
if (requiredColumns + leftGutterColumnCount + rightGutterColumnCount > 24) rightGutterColumnCount = 0;
|
||||
if (requiredColumns + leftGutterColumnCount + rightGutterColumnCount > 24) leftGutterColumnCount = 0;
|
||||
const baseColumnCount = Math.min(
|
||||
|
||||
@@ -59,6 +59,18 @@ const createConfiguredAssistantAsync = async () => {
|
||||
return db;
|
||||
};
|
||||
|
||||
describe("assistantRouter.getAdminConfiguration", () => {
|
||||
test("defaults an unconfigured Assistant to the Homarr provider", async () => {
|
||||
const caller = assistantRouter.createCaller({ db: createDb(), deviceType: undefined, session: adminSession });
|
||||
|
||||
await expect(caller.getAdminConfiguration()).resolves.toMatchObject({
|
||||
connectionConfigured: false,
|
||||
provider: "homarr",
|
||||
baseUrl: "https://homarr.dev/api/ai/v1",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("assistantRouter.updateConnection", () => {
|
||||
test("clears the persisted model when the discovery path changes without clearing credentials", async () => {
|
||||
const db = await createConfiguredAssistantAsync();
|
||||
|
||||
@@ -307,6 +307,7 @@ describe("onboard.completeSetup", () => {
|
||||
...completionInput("missing").board,
|
||||
id: undefined,
|
||||
name: "Recovered-board",
|
||||
columnCount: 14,
|
||||
leftSidebar: true,
|
||||
rightSidebar: true,
|
||||
},
|
||||
@@ -328,7 +329,7 @@ describe("onboard.completeSetup", () => {
|
||||
expect.objectContaining({ role: "mobile", columnCount: 3, breakpoint: 0 }),
|
||||
expect.objectContaining({
|
||||
role: "base",
|
||||
columnCount: 10,
|
||||
columnCount: 14,
|
||||
breakpoint: 768,
|
||||
leftGutterColumnCount: 1,
|
||||
rightGutterColumnCount: 1,
|
||||
|
||||
Reference in new issue
Block a user