feat(kiwi-fe): wire OrchUsagePill into RecipesView and Settings opt-in toggle
- Import and mount OrchUsagePill near the recipe level selector in RecipesView; pill is self-hiding when not enabled or no lifetime key is present - Add useOrchUsage composable to SettingsView with a Display section checkbox so users can opt in to seeing the cloud recipe call budget pill - Add @/ path alias to vite.config.ts and tsconfig.app.json to resolve the existing @/services/api import in useOrchUsage.ts (fixes vite build error) - tsc --noEmit and vite build both pass clean
This commit is contained in:
parent
1ae54c370d
commit
33c619b6b5
4 changed files with 44 additions and 0 deletions
|
|
@ -75,6 +75,8 @@
|
||||||
<p v-if="activeLevel" class="level-description text-sm text-secondary mt-xs">
|
<p v-if="activeLevel" class="level-description text-sm text-secondary mt-xs">
|
||||||
{{ activeLevel.description }}
|
{{ activeLevel.description }}
|
||||||
</p>
|
</p>
|
||||||
|
<!-- Orch budget pill — only visible when user has opted in (Settings toggle) -->
|
||||||
|
<OrchUsagePill class="mt-xs" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Surprise Me confirmation -->
|
<!-- Surprise Me confirmation -->
|
||||||
|
|
@ -604,6 +606,7 @@ import RecipeBrowserPanel from './RecipeBrowserPanel.vue'
|
||||||
import SavedRecipesPanel from './SavedRecipesPanel.vue'
|
import SavedRecipesPanel from './SavedRecipesPanel.vue'
|
||||||
import CommunityFeedPanel from './CommunityFeedPanel.vue'
|
import CommunityFeedPanel from './CommunityFeedPanel.vue'
|
||||||
import BuildYourOwnTab from './BuildYourOwnTab.vue'
|
import BuildYourOwnTab from './BuildYourOwnTab.vue'
|
||||||
|
import OrchUsagePill from './OrchUsagePill.vue'
|
||||||
import type { ForkResult } from '../stores/community'
|
import type { ForkResult } from '../stores/community'
|
||||||
import type { RecipeSuggestion, GroceryLink } from '../services/api'
|
import type { RecipeSuggestion, GroceryLink } from '../services/api'
|
||||||
import { recipesAPI } from '../services/api'
|
import { recipesAPI } from '../services/api'
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,22 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Display Preferences -->
|
||||||
|
<section class="mt-md">
|
||||||
|
<h3 class="text-lg font-semibold mb-xs">Display</h3>
|
||||||
|
<label class="orch-pill-toggle flex-start gap-sm text-sm">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
:checked="orchPillEnabled"
|
||||||
|
@change="setOrchPillEnabled(($event.target as HTMLInputElement).checked)"
|
||||||
|
/>
|
||||||
|
Show cloud recipe call budget in Recipes
|
||||||
|
</label>
|
||||||
|
<p class="text-xs text-muted mt-xs">
|
||||||
|
Displays your remaining cloud recipe calls near the level selector. Only visible if you have a lifetime or founders key.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mt-md">
|
<div class="card mt-md">
|
||||||
<h2 class="section-title text-xl mb-md">Cook History</h2>
|
<h2 class="section-title text-xl mb-md">Cook History</h2>
|
||||||
|
|
@ -159,9 +175,11 @@ import { ref, computed, onMounted } from 'vue'
|
||||||
import { useSettingsStore } from '../stores/settings'
|
import { useSettingsStore } from '../stores/settings'
|
||||||
import { useRecipesStore } from '../stores/recipes'
|
import { useRecipesStore } from '../stores/recipes'
|
||||||
import { householdAPI, type HouseholdStatus } from '../services/api'
|
import { householdAPI, type HouseholdStatus } from '../services/api'
|
||||||
|
import { useOrchUsage } from '../composables/useOrchUsage'
|
||||||
|
|
||||||
const settingsStore = useSettingsStore()
|
const settingsStore = useSettingsStore()
|
||||||
const recipesStore = useRecipesStore()
|
const recipesStore = useRecipesStore()
|
||||||
|
const { enabled: orchPillEnabled, setEnabled: setOrchPillEnabled } = useOrchUsage()
|
||||||
|
|
||||||
const sortedCookLog = computed(() =>
|
const sortedCookLog = computed(() =>
|
||||||
[...recipesStore.cookLog].sort((a, b) => b.cookedAt - a.cookedAt)
|
[...recipesStore.cookLog].sort((a, b) => b.cookedAt - a.cookedAt)
|
||||||
|
|
@ -450,4 +468,17 @@ onMounted(async () => {
|
||||||
font-size: var(--font-size-xs);
|
font-size: var(--font-size-xs);
|
||||||
color: var(--color-text-muted);
|
color: var(--color-text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.orch-pill-toggle {
|
||||||
|
cursor: pointer;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.orch-pill-toggle input[type="checkbox"] {
|
||||||
|
accent-color: var(--color-primary);
|
||||||
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||||
"types": ["vite/client"],
|
"types": ["vite/client"],
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["src/*"]
|
||||||
|
},
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,15 @@
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
base: process.env.VITE_BASE_URL ?? '/',
|
base: process.env.VITE_BASE_URL ?? '/',
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
},
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
output: {
|
output: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue