Problem Statement
Two settings tabs have hardcoded URL strings used as input placeholder text:
src/settings/tabs/ModelTab.tsx — "http://127.0.0.1:11434" (the default Ollama endpoint)
src/settings/tabs/SearchTab.tsx — "http://127.0.0.1:25017" and "http://127.0.0.1:25018" (search sandbox endpoints)
These same URL strings also appear in documentation and other parts of the codebase. If the default ports ever change, or if we want to reuse these values elsewhere, having them as named constants makes that easy. Right now they are scattered inline strings.
Proposed Solution
Move the hardcoded URL strings into a shared constants file and reference them by name.
Steps
-
Create (or extend) a constants file
A good location is src/config/constants.ts. If the file does not exist yet, create it.
Define the constants there:
export const DEFAULT_OLLAMA_URL = 'http://127.0.0.1:11434';
export const DEFAULT_SEARCH_URL_PRIMARY = 'http://127.0.0.1:25017';
export const DEFAULT_SEARCH_URL_SECONDARY = 'http://127.0.0.1:25018';
Choose names that make the purpose clear. The names above are suggestions.
-
Update ModelTab.tsx
Import the constant and replace the inline string in the placeholder prop.
-
Update SearchTab.tsx
Same: import and replace both inline URL strings.
-
Check for other occurrences
Run a quick search for 11434, 25017, and 25018 in src/ to see if these values appear anywhere else. If so, replace those too.
Definition of Done
Getting Started
- Open
src/settings/tabs/ModelTab.tsx and search for 11434
- Open
src/settings/tabs/SearchTab.tsx and search for 25017 and 25018
- Create
src/config/constants.ts with the named exports
- Replace the inline strings and import the constants
- Run
bun run validate-build to confirm nothing is broken
This is a pure refactor: no behavior changes, no new features. It is a great way to get familiar with the codebase structure before tackling something bigger.
Questions? Leave a comment on this issue.
Problem Statement
Two settings tabs have hardcoded URL strings used as input placeholder text:
src/settings/tabs/ModelTab.tsx—"http://127.0.0.1:11434"(the default Ollama endpoint)src/settings/tabs/SearchTab.tsx—"http://127.0.0.1:25017"and"http://127.0.0.1:25018"(search sandbox endpoints)These same URL strings also appear in documentation and other parts of the codebase. If the default ports ever change, or if we want to reuse these values elsewhere, having them as named constants makes that easy. Right now they are scattered inline strings.
Proposed Solution
Move the hardcoded URL strings into a shared constants file and reference them by name.
Steps
Create (or extend) a constants file
A good location is
src/config/constants.ts. If the file does not exist yet, create it.Define the constants there:
Choose names that make the purpose clear. The names above are suggestions.
Update
ModelTab.tsxImport the constant and replace the inline string in the
placeholderprop.Update
SearchTab.tsxSame: import and replace both inline URL strings.
Check for other occurrences
Run a quick search for
11434,25017, and25018insrc/to see if these values appear anywhere else. If so, replace those too.Definition of Done
ModelTab.tsxuses the constant instead of the inline stringSearchTab.tsxuses the constants instead of the inline stringssrc/bun run test:all:coveragepasses (100% coverage maintained)bun run validate-buildpasses with zero warnings and zero errorsGetting Started
src/settings/tabs/ModelTab.tsxand search for11434src/settings/tabs/SearchTab.tsxand search for25017and25018src/config/constants.tswith the named exportsbun run validate-buildto confirm nothing is brokenThis is a pure refactor: no behavior changes, no new features. It is a great way to get familiar with the codebase structure before tackling something bigger.
Questions? Leave a comment on this issue.