-
Notifications
You must be signed in to change notification settings - Fork 46
feat: Add dual language selector for AI Transport guides #3176
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
base: main
Are you sure you want to change the base?
feat: Add dual language selector for AI Transport guides #3176
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
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add Client/Agent dropdowns for separate frontend/backend language selection - Support fe_/be_ prefixed code blocks in MDX files - Preserve language params when navigating between guide pages - Add aiTransport languages (javascript, python, swift, java) - Add Guides section to AI Transport nav - Update anthropic-message-per-response guide with dual language code blocks - Update @ably/ui to 17.13.1-dev.c839343a URL params: ?fe_lang=xxx&be_lang=yyy
The test mock for layout-context was missing the isDualLanguagePath function that LeftSidebar imports, causing TypeError during test runs.
Extends the If component to support dual-language page conditionals: - fe_lang: show content when frontend language matches - be_lang: show content when backend language matches - fe_or_be_lang: show content when either matches (with deduplication) Used in AI Transport guides for language-specific prerequisites and SDK links.
- Add directory references to file creation instructions (e.g., "In your ably-anthropic-agent directory, create publisher.mjs") - Add cd commands to run instructions for publisher and subscriber - Add directory context to Step 6 rewind instructions - Fix Swift Package.swift code block to use fe_swift prefix - Wrap URL code block in Code component with text language
Move "Message per response" before "Message per token" in navigation for all AI providers (Anthropic, OpenAI, LangGraph, Vercel AI SDK).
a5fe2ec to
c5eb002
Compare
|
I haven't reviewed the code in detail, I will leave that to someone in the docs/deved team. But from a UX perspective, I really like the approach and I am happy with this :) |
Summary
Adds dual language selection for AI Transport guide pages, allowing users to independently choose Client (frontend) and Agent (backend) languages for code examples.
Changes
?fe_lang=xxx&be_lang=yyyfor bookmarking and sharing specific language combinationsfe_andbe_prefixes (e.g.,fe_javascript,be_python) to distinguish frontend vs backend codeSupported languages
Dependencies
@ably/ui@17.13.1-dev.c839343a(or later) withfe_/be_prefix support in CodeSnippet