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

[DOC]: Fix anchors in links to docs.trychroma.com #3411

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

ahmedaabouzied
Copy link
Contributor

Closes #3395

Description of changes

  • The app context responsible of redirecting pages to either the JS docs or python docs was stripping out the hash (anchor) if you're navigating to a documentation page with an anchor such as https://docs.trychroma.com/reference/python/client#deletecollection.
  • This PR fixes this issue by appending the hash to the URL being redirected to if it's valid to append the hash.
  • Also cleaning up a bit by removing a not used import of react useContext.

Test plan

N/A

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?
N/A

- Closes chroma-core#3395
- Also removes the not used useContext react import.

Signed-off-by: Ahmed Abouzied <[email protected]>
Copy link

github-actions bot commented Jan 6, 2025

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@tazarov
Copy link
Contributor

tazarov commented Jan 6, 2025

@ahmedaabouzied, thanks for this. I ran your code locally and noticed a next.js error in the use of window - Error: window is not defined and it kind of makes sense if this is not in browser so I moved the anchor handling logic inside the useEffect and now it works like a charm without gobbling the anchors when the page is loaded.

@tazarov
Copy link
Contributor

tazarov commented Jan 6, 2025

@itaismith PTAL. For some reason this does not trigger vercel preview but locally npm run dev things seem to work.

@HammadB HammadB requested a review from itaismith January 6, 2025 21:48
@itaismith itaismith merged commit 5f42719 into chroma-core:main Jan 7, 2025
11 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.

[Bug]: Anchors in links to docs.trychroma.com don't work
3 participants