Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Config API and Settings pages for Reuse and Consistency #852

Merged

Conversation

debanjum
Copy link
Member

@debanjum debanjum commented Jul 16, 2024

Major

  • Reuse get config data logic across config pages on web client
  • Make config api endpoint urls and response fields consistent
  • Rename API path /api/config to /api/configure
  • Move Web, Desktop client settings page to be under /settings from the previous /config url path

Minor

  • Pass isMobileWidth prop to SidePanel via chat share interface
  • Turn prettier off instead of throwing error for now
  • Do no explicitly add line-clamp plugin as it's in Tailwind by default

- Put logic to get config data, detailed or basic into router helpers module
- Use the get config func across the config pages on web clients

- Put configure content and get_notion_auth_url funcs in router helper
  module to avoid circular import
- Consistently use /content/ for data. Remove content-source from path
- Remove unnecessary /data/ prefix for API endpoints under /config
- Update clients calling /api/config to call /api/configure instead
Update docs, clients and error messages to point to /configure
instead of /config
Update references to point to page at /configure instead of /config
Until web interface code is reformatted with prettier
@debanjum debanjum added the maintain Maintain code, documentation or project label Jul 16, 2024
@debanjum debanjum requested a review from sabaimran July 16, 2024 16:48
src/interface/web/app/components/navMenu/navMenu.tsx Outdated Show resolved Hide resolved
src/interface/web/app/components/navMenu/navMenu.tsx Outdated Show resolved Hide resolved
src/interface/web/app/factchecker/page.tsx Outdated Show resolved Hide resolved
src/khoj/routers/helpers.py Show resolved Hide resolved
src/khoj/routers/helpers.py Outdated Show resolved Hide resolved
src/khoj/routers/web_client.py Outdated Show resolved Hide resolved
src/khoj/routers/web_client.py Outdated Show resolved Hide resolved
- Use name, id for every [search|chat|voice|pain]_model_option
- Rename current_model_state field to more intuitive enabled_content_source
- Update references to the update fields in config.html
@debanjum debanjum force-pushed the make-config-api-clean-consistent branch from 3abe947 to 1d943ec Compare July 17, 2024 07:35
There are a lot of fields being returned. Group returned fields and
add comment header to each Group for readability
- Update references to the settings page to use new url across docs
  and code
- Rename desktop and web settings page to settigns.html instead of
  config[ure].html
@debanjum debanjum force-pushed the make-config-api-clean-consistent branch from 1d943ec to a1c362a Compare July 17, 2024 07:47
@debanjum debanjum changed the title Rename path to Config API, Pages. Reuse get user config logic Refactor Config API and Settings pages for Reuse and Consistency Jul 17, 2024
@debanjum debanjum merged commit bf815e4 into features/big-upgrade-chat-ux Jul 17, 2024
5 checks passed
@debanjum debanjum deleted the make-config-api-clean-consistent branch July 17, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintain Maintain code, documentation or project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants