-
Notifications
You must be signed in to change notification settings - Fork 43
[WEB-4440] Add Open in ChatGPT button to right sidebar #2654
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
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes update the "@ably/ui" dependency version in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RightSidebar
participant ExternalLinks
User->>RightSidebar: Render sidebar
RightSidebar->>ExternalLinks: Call externalLinks(activePage)
ExternalLinks-->>RightSidebar: Return array of links (includes "Open in ChatGPT")
RightSidebar->>User: Render external links with updated borders
Assessment against linked issues
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
e39d0ba
to
11d3017
Compare
11d3017
to
0dda364
Compare
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/components/Layout/RightSidebar.tsx (2)
35-38
: Early return is 👍 – but drop the now-unused variable
githubEditPath
is declared before the guard but never used whenactivePage
is falsy.
Declare it after the guard to avoid an unnecessary binding (and satisfy strict-lint rules like@typescript-eslint/no-unnecessary-init
).
51-52
: Guard against undefinedlanguages
activePage.languages
is assumed to exist. If the type allowsundefined
, this will throw. Consider a safer check:const hasLanguages = Array.isArray(activePage.languages) && activePage.languages.length > 0; const language = hasLanguages ? activePage.language : null;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (2)
package.json
(1 hunks)src/components/Layout/RightSidebar.tsx
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/Layout/RightSidebar.tsx (1)
src/data/languages/index.ts (1)
languageInfo
(16-16)
🔇 Additional comments (3)
package.json (1)
42-45
: Verify that the@ably/ui
minor bump has no breaking side-effects
@ably/ui
jumped from17.1.0
→17.2.1
.
Even minor releases can introduce changed exports or stricter peer-dependency ranges. Before merging, run the visual regression tests / Storybook and a production build to ensure components (especiallyIcon
,cn
, heights utils) still tree-shake correctly and no styling regressions slip in.src/components/Layout/RightSidebar.tsx (2)
62-64
: Double-check the ChatGPT deep-link formatThe link uses
https://chatgpt.com/?q=…
. The public interface commonly expectshttps://chat.openai.com/?q=
(orprompt=
depending on A/B experiments). A quick manual test is recommended to confirm the URL pre-fills the prompt as intended.
258-260
: Border switch is correctSwitching from “bottom border on first item” to “top border on subsequent items” aligns with the surrounding card pattern and fixes the missing divider when items overflow. Looks good.
0dda364
to
575ffc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yey! more AI-integrated experience 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice quick addition!
I saw you added the language that was being viewed, but In the interest of providing additional context, I think it might be worth including the product as well (e.g. Tell me more about Ably Chat's X
). I had some slightly confusing results viewing history in Chat as it was pulling some info from Pub/Sub for example that wasn't relevant.
You can also get some weird results if you navigate to a page with a query param set for a language that doesn't support that feature, but I think that's potentially unavoidable.
Thanks @m-hulbert - we have access to a page's product so can work that in. As for the query param, I think we can do something around that - the query param overrides the language, but we also know the languages supported by a page, so we can adjust the condition so that we only include the language part of the prompt if the param either isn't there or lines up with a valid lang on the page. |
575ffc7
to
10e54d2
Compare
10e54d2
to
14db600
Compare
Adds an "Open in ChatGPT" button to the right-hand nav sidebar in docs with the prompt "Tell me more about Ably's X feature from Y for Z" where
X
is the name of the featureY
is the docs page describing the feature (we can update this to a Markdown resource later when that functionality is ready - currently in the works by @kennethkalmer)Z
is the targeted programming language, only appended if applicable (it wouldn't be on the Chat index page, for instance)Review link (with example page): https://ably-docs-web-4440-gpt--8g8gqj.herokuapp.com/docs/chat/rooms/message-reactions
Summary by CodeRabbit
New Features
Style