Skip to content

chore: extract hardcoded URL placeholders into shared constants#169

Merged
quiet-node merged 1 commit into
quiet-node:mainfrom
andrewholzbach:refactor/url-constants
May 14, 2026
Merged

chore: extract hardcoded URL placeholders into shared constants#169
quiet-node merged 1 commit into
quiet-node:mainfrom
andrewholzbach:refactor/url-constants

Conversation

@andrewholzbach
Copy link
Copy Markdown
Contributor

@andrewholzbach andrewholzbach commented May 13, 2026

Description

Fixes #138

Changes

  • Replaced hardcoded placeholder strings in ModelTab and SearchTab with values read directly from the config prop (config.inference.ollama_url, config.search.searxng_url, config.search.reader_url)

Checklist

  • Tests added or updated for all changed code
  • bun run test:all:coverage passes with 100% coverage
  • bun run validate-build passes with zero warnings and zero errors
  • Commit message follows Conventional Commits (feat:, fix:, etc.) so the changelog is generated automatically

@quiet-node
Copy link
Copy Markdown
Owner

Hey, thanks for opening this PR!

The CI runs are failing due to a transient GitHub Actions git fetch error, the runners couldn't check out the branch, so none of the tests or build steps actually ran. No issues with your code.

I'll be re-running the jobs periodically until they go through cleanly.

Comment thread src/config/constants.ts Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks like DEFAULT_OLLAMA_URL, DEFAULT_SEARXNG_URL, and DEFAULT_READER_URL are already declared in src-tauri/src/config/defaults.rs. The settings tabs already receive the resolved config as a prop via ConfigContext, so the placeholder values can come from there directly. Could we drop src/config/constants.ts and use that existing source of truth instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could, for example it would just look like placeholder={config.inference.ollama_url} in src/settings/tabs/ModelTab.tsx. I figured there might be a reason to have the placeholders strings configured in a different place than the actual resolved url values coming from tauri but otherwise there isn't a point in having src/config/constants.ts. Lmk and I can fix for using defaults.rs instead if preferred

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I would prefer to place it in src-tauri/src/config/defaults.rs to avoid duplicated code and maintain a single source of truth for the configs. This makes maintenance easier and helps keep things consistent.

@quiet-node
Copy link
Copy Markdown
Owner

Also kindly update the PR title to match conventional git commit guidelines as we use the Google release-please workflow to automate releases based on the commit message. This fits as a chore: commit.

@andrewholzbach andrewholzbach changed the title Extracted hardcoded placeholder URLs to new constants.ts chore: extract hardcoded URL placeholders into shared constants May 13, 2026
@andrewholzbach andrewholzbach force-pushed the refactor/url-constants branch from 6304ad6 to 42cbed2 Compare May 13, 2026 22:37
@andrewholzbach andrewholzbach force-pushed the refactor/url-constants branch from 42cbed2 to 67b2b38 Compare May 13, 2026 22:50
Copy link
Copy Markdown
Owner

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Perfect LGTM thanks much again for the effort!

@quiet-node quiet-node merged commit 4d8a4c3 into quiet-node:main May 14, 2026
0 of 3 checks passed
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.

Refactor: Extract hardcoded placeholder URLs to constants

2 participants