Skip to content

Commit

Permalink
feat: harbor alias, up tails
Browse files Browse the repository at this point in the history
fix: dict config escape, app to account for possibly deleted configs
chore: doctor to show home path
  • Loading branch information
av committed Oct 27, 2024
1 parent b13285f commit 729ef64
Show file tree
Hide file tree
Showing 14 changed files with 233 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .scripts/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as toml from 'jsr:@std/toml';
import * as path from 'jsr:@std/path';
import * as collections from "jsr:@std/collections/deep-merge";

const VERSION = "0.2.11";
const VERSION = "0.2.12";

type ValueSeed = {
// Path relative to the project root
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"file": ".copilot-instructions.md"
}
],
"deno.enable": true
"deno.enable": false
}
7 changes: 7 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ bun install

# Run the app in development mode
bun tauri dev
```

## Build

```bash
# For the currnet targets
bun tauri build
```
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@avcodes/harbor-app",
"private": true,
"version": "0.2.11",
"version": "0.2.12",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[package]
name = "harbor-app"
version = "0.2.11"
version = "0.2.12"
description = "A companion app for Harbor LLM toolkit"
authors = ["av"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2.0.0-rc",
"productName": "Harbor",
"version": "0.2.11",
"version": "0.2.12",
"identifier": "com.harbor.app",
"build": {
"beforeDevCommand": "bun run dev",
Expand Down
12 changes: 11 additions & 1 deletion app/src/settings/ProfileSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { IconCirclePlus } from "../Icons";
import { HarborConfig } from "../config/HarborConfig";
import { HarborConfigEditor } from "../config/HarborConfigEditor";
import { orderByPredefined } from "../utils";
import { EXTRA, SORT_ORDER } from "../configMetadata";
import { CURRENT_PROFILE, EXTRA, SORT_ORDER } from "../configMetadata";
import { useSelectedProfile } from "../useSelectedProfile";
import { useOverlays } from "../OverlayContext";
import { ConfigNameModal } from "../config/ConfigNameModal";
import { useEffect } from "react";

export const ProfileSelector = (
{ configs }: { configs: HarborConfig[] },
Expand All @@ -17,6 +18,15 @@ export const ProfileSelector = (
const configMap = new Map(
configs.map((config) => [config.profile.name, config]),
);

useEffect(() => {
if (!configMap.has(selected)) {
// We lost previously selected
// profile in one way or another
setSelected(CURRENT_PROFILE);
}
}, [configs]);

const currentConfig = configMap.get(selected);
const sorted = orderByPredefined(
configs.map((c) => c.profile.name),
Expand Down
Loading

0 comments on commit 729ef64

Please sign in to comment.