diff --git a/app.go b/app.go index aab85c61..b52fd7c4 100644 --- a/app.go +++ b/app.go @@ -19,6 +19,7 @@ import ( "solo/internal/configuration" "solo/internal/environment" "solo/internal/exporter" + "solo/internal/fonts" "solo/internal/git" "solo/internal/host" "solo/internal/importer" @@ -375,6 +376,32 @@ func (a *App) GetThemeByName(themeName string) (*theme.Theme, error) { return a.configManager.GetThemeByName(themeName) } +// Font Management Methods + +// SetDefaultFontFamily sets the default font family and persists the change. +func (a *App) SetDefaultFontFamily(fontFamily string) error { + if a.configManager == nil { + return fmt.Errorf("configuration manager not initialized") + } + return a.configManager.SetDefaultFontFamily(fontFamily) +} + +// SetMonoFontFamily sets the monospace font family and persists the change. +func (a *App) SetMonoFontFamily(fontFamily string) error { + if a.configManager == nil { + return fmt.Errorf("configuration manager not initialized") + } + return a.configManager.SetMonoFontFamily(fontFamily) +} + +// SetZoomLevel updates and persists the UI zoom level. +func (a *App) SetZoomLevel(level float64) error { + if a.configManager == nil { + return fmt.Errorf("configuration manager not initialized") + } + return a.configManager.SetZoomLevel(level) +} + // Host Management Methods // GetAllHosts returns a list of all configured hosts. @@ -814,6 +841,11 @@ func (a *App) GetDefaultConfiguration() (configuration.Configuration, error) { return a.configManager.GetDefaultConfiguration(), nil } +// ListSystemFonts returns installed system font families with monospace metadata. +func (a *App) ListSystemFonts(refresh bool) ([]fonts.SystemFont, error) { + return fonts.ListFamilies(refresh) +} + // Request Management Methods // GetRequests returns all requests within a specific collection. diff --git a/docs/releases/next.md b/docs/releases/next.md index fd5a76e3..e1512b1e 100644 --- a/docs/releases/next.md +++ b/docs/releases/next.md @@ -3,10 +3,18 @@ ## Highlights ## ✨ New Features + - Add stop button to cancel an ongoing HTTP request before the timeout expires ([#146](https://github.com/raml-dev/solo/issues/146)). - Add stop button to the parallel runner to cancel an in-progress run ([#152](https://github.com/raml-dev/solo/issues/152)). - Enhanced OpenAPI, Bruno, and Postman importers with full support for query parameters, form bodies, and recursive reference resolution. Introduced smart placeholders for missing examples and standardized binary file handling across all formats ([#148](https://github.com/raml-dev/solo/pull/148)). +- Added UI to change fonts ([#150](https://github.com/raml-dev/solo/pull/150)) ## 🐞 Bug fixes - Fix failing tests on particular conditions by adding a helper to create temp testing folders ([#145](https://github.com/raml-dev/solo/pull/145)) + +## ⬆️ Dependency updates + +- Updated Svelte to `5.55.7` ([#155](https://github.com/raml-dev/solo/pull/155)) +- Updated go to `1.26.3` ([#150](https://github.com/raml-dev/solo/pull/150)) +- Added [golang.org/x/image v0.39.0](https://pkg.go.dev/golang.org/x/image) ([#150](https://github.com/raml-dev/solo/pull/150)) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d3a63165..4cda780e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1561,9 +1561,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.5.tgz", - "integrity": "sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==", + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 786221da..f298e037 100755 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -5cb7e31dc24be576a4d6e677d2b522a4 \ No newline at end of file +a0d58cdeee5fe9a475016d1d05aad5c9 \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 5d5aaff6..53432756 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -13,20 +13,28 @@ import HTTPRequestBuilder from "$src/lib/components/RequestBuilder/HTTPRequestBuilder.svelte"; import RequestTabBar from "$src/lib/components/RequestBuilder/RequestTabBar.svelte"; import { collectionStore } from "$src/lib/stores/collectionStore.svelte"; - import { configurationStore } from "$src/lib/stores/configurationStore.svelte"; + import { + configurationStore, + configurationStoreState + } from "$src/lib/stores/configurationStore.svelte"; import { environmentStore, environmentStoreState } from "$src/lib/stores/environmentStore.svelte"; + import { fontListsStore } from "$src/lib/stores/fontListsStore.svelte"; import { historyStore } from "$src/lib/stores/historyStore.svelte"; import { hasOpenModals, modalStack } from "$src/lib/stores/modalStackStore.svelte"; import { notifications } from "$src/lib/stores/notificationStore"; import { getActiveTab, tabStore } from "$src/lib/stores/tabStore.svelte"; import { updateStore } from "$src/lib/stores/updateStore.svelte"; import { initWindowDimensions } from "$src/lib/stores/windowDimensionsStore.svelte"; - import { initZoom } from "$src/lib/stores/zoomStore.svelte"; + import { initZoom, registerZoomShortcuts } from "$src/lib/stores/zoomStore.svelte"; import { flowbiteTheme } from "$src/lib/theme/flowbiteCustomTheme"; + import { + APP_HISTORY_PANE_MAX_HEIGHT, + APP_HISTORY_PANE_MIN_HEIGHT + } from "$src/lib/utils/constants"; import { EventsOn } from "$wails/runtime/runtime"; + import ClockArrowOutline from "flowbite-svelte-icons/ClockArrowOutline.svelte"; import EditOutline from "flowbite-svelte-icons/EditOutline.svelte"; import GlobeOutline from "flowbite-svelte-icons/GlobeOutline.svelte"; - import ClockArrowOutline from "flowbite-svelte-icons/ClockArrowOutline.svelte"; import Badge from "flowbite-svelte/Badge.svelte"; import Button from "flowbite-svelte/Button.svelte"; import ThemeProvider from "flowbite-svelte/ThemeProvider.svelte"; @@ -40,15 +48,15 @@ const environmentManagerModal = modalStack.createModal("app-environments"); let historyOpen = $state(false); - let consoleHeight = $state(260); - const MIN_HEIGHT = 120; - const MAX_HEIGHT = 700; + let historyPaneHeight = $state(260); let isResizing = $state(false); let resizeStartY = 0; let resizeStartH = 0; async function initializeApp() { await configurationStore.init(); + initZoom(configurationStoreState.config.general.zoomLevel); + void fontListsStore.init(); await Promise.all([ updateStore.init(), collectionStore.loadCollections(), @@ -73,7 +81,7 @@ function startResize(e: MouseEvent) { isResizing = true; resizeStartY = e.clientY; - resizeStartH = consoleHeight; + resizeStartH = historyPaneHeight; window.addEventListener("mousemove", onMouseMove); window.addEventListener("mouseup", stopResize); } @@ -81,7 +89,10 @@ function onMouseMove(e: MouseEvent) { const delta = resizeStartY - e.clientY; - consoleHeight = Math.min(MAX_HEIGHT, Math.max(MIN_HEIGHT, resizeStartH + delta)); + historyPaneHeight = Math.min( + APP_HISTORY_PANE_MAX_HEIGHT, + Math.max(APP_HISTORY_PANE_MIN_HEIGHT, resizeStartH + delta) + ); } function stopResize() { @@ -187,7 +198,7 @@ }); }); - const zoomCleanup = initZoom(); + const zoomCleanup = registerZoomShortcuts(); const windowDimensionsCleanup = initWindowDimensions(); return () => { @@ -260,14 +271,14 @@ {#if historyOpen}