Skip to content

feat(developer-portal): integrate docs AI widget and landing updates#687

Open
wabicai wants to merge 26 commits intoonekeyfrom
codex/add-doc-ai-chat-widget
Open

feat(developer-portal): integrate docs AI widget and landing updates#687
wabicai wants to merge 26 commits intoonekeyfrom
codex/add-doc-ai-chat-widget

Conversation

@wabicai
Copy link
Member

@wabicai wabicai commented Mar 3, 2026

Changes

  • integrate the Docs AI widget into developer-portal and keep the modal available by default
  • route chat requests by deployment hostname, while still allowing NEXT_PUBLIC_DOCS_AI_API_URL to override for local or staging
  • sanitize retrieval scaffold text in assistant messages so the UI only shows the grounded answer content
  • fix source-only responses so copy and retry continue to work correctly, and keep source cards rendered separately
  • polish the Search / Ask AI panel visual design and keyboard navigation bridge
  • sync the landing page footer with the latest hardware-js-sdk PR fix(developer-portal): restore footer layout with SDK version and commit hash #692 layout updates

Validation

  • removed local Playwright screenshots and other test artifacts from the worktree before pushing
  • yarn build:docs
  • verified previously with local end-to-end flows against the RAG service for source display, copy, and retry behavior

Notes

  • this PR depends on the RAG service changes for direct Context7 answers, but the frontend now handles fallback responses correctly
  • direct answers from Context7 still depend on the final docs site origin being allowed in the widget settings

@revan-zhang
Copy link
Contributor

revan-zhang commented Mar 3, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@socket-security
Copy link

socket-security bot commented Mar 3, 2026

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm @polkadot/util-crypto is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: packages/connect-examples/expo-example/package.jsonnpm/@polkadot/util-crypto@13.1.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@polkadot/util-crypto@13.1.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm @react-native/debugger-frontend is 96.0% likely obfuscated

Confidence: 0.96

Location: Package overview

From: ?npm/@react-native/debugger-frontend@0.73.3

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@react-native/debugger-frontend@0.73.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@wabicai wabicai changed the title feat(developer-portal): 接入 assistant-ui 文档 AI 对话弹窗 feat(developer-portal): 接入文档 AI 对话弹窗 Mar 3, 2026
@wabicai wabicai marked this pull request as draft March 3, 2026 08:22
@wabicai wabicai changed the title feat(developer-portal): 接入文档 AI 对话弹窗 feat(developer-portal): integrate docs AI chat widget Mar 5, 2026
@socket-security
Copy link

socket-security bot commented Mar 9, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​polkadot/​util-crypto@​13.1.1401008088100
Added@​babel/​plugin-proposal-object-rest-spread@​7.20.71001007550100
Added@​babel/​plugin-proposal-optional-chaining@​7.21.01001007450100
Added@​radix-ui/​react-separator@​1.1.71001006791100
Added@​tamagui/​babel-plugin@​1.90.2991006994100
Added@​radix-ui/​react-progress@​1.1.71001006991100
Added@​radix-ui/​react-slot@​1.2.31001006991100
Added@​nexajs/​script@​23.12.13751006982100
Added@​types/​bchaddrjs@​0.4.31001007079100
Added@​radix-ui/​react-checkbox@​1.3.2991007192100
Added@​babel/​preset-react@​7.22.151001007193100
Added@​radix-ui/​react-dropdown-menu@​2.1.15991007192100
Added@​radix-ui/​react-dialog@​1.1.14991007192100
Added@​tamagui/​toast@​1.90.2911007296100
Added@​radix-ui/​react-tooltip@​1.2.7991007292100
Added@​react-navigation/​bottom-tabs@​6.5.121001007397100
Added@​radix-ui/​react-toast@​1.2.14991007392100
Added@​babel/​preset-typescript@​7.23.31001007393100
Added@​types/​bytebuffer@​5.0.431001007377100
Added@​radix-ui/​react-scroll-area@​1.2.9991007391100
Added@​onekeyfe/​cross-inpage-provider-core@​0.0.17851007397100
Added@​react-navigation/​native-stack@​6.9.181001007399100
Added@​alephium/​web3-wallet@​1.5.280100739770
Added@​radix-ui/​react-select@​2.2.5981007492100
Added@​types/​bn.js@​5.1.51001007481100
Added@​nexajs/​address@​23.12.257510010082100
Added@​react-navigation/​native@​6.1.10991007599100
Added@​tamagui/​config@​1.90.2921007694100
Added@​onekeyfe/​react-native-ble-utils@​0.1.4771008084100
Updated@​babel/​core@​7.28.5 ⏵ 7.23.998 +11008095100
Added@​ckb-lumos/​helpers@​0.23.08110010083100
Added@​ton/​core@​0.57.01001008292100
Added@​scure/​bip39@​1.3.010010010082100
See 19 more rows in the dashboard

View full report

@wabicai wabicai changed the title feat(developer-portal): integrate docs AI chat widget feat(developer-portal): integrate docs AI widget and landing updates Mar 11, 2026
@wabicai wabicai marked this pull request as ready for review March 11, 2026 04:59
- Add i18n to DeviceActionAnimation (7 hardcoded Chinese strings)
- Fix Chinese fallback text in PinDialog and PassphraseDialog t() calls
- Fix Chinese console.log/error messages in GlobalDialogManager, PinDialog, PassphraseDialog
- Fix Chinese default title in UnifiedLogger
- Add deviceAction i18n keys to en.ts and zh.ts
- Fix malformed code blocks in nip04.decrypt.mdx and nip04.encrypt.mdx
- Fix stray code block delimiter in devicesettings.mdx (en + zh)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wabicai wabicai force-pushed the codex/add-doc-ai-chat-widget branch from 0bcf166 to 99d2b2d Compare March 13, 2026 03:37
wabicai and others added 5 commits March 13, 2026 11:37
The commit hash is already displayed in the bottom corner, so the one
in the header is redundant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace streaming <pre> raw-text fallback with ReactMarkdown +
  disableHighlight during streaming, eliminating the jarring jump from
  plain text to fully-rendered markdown when a response completes
- Remove redundant normalizeMarkdownArtifacts wrapper that duplicated
  the same replacements already applied by sanitizeDocAIMessageText;
  pass the pre-sanitized text prop directly to ReactMarkdown
- Rename .assistantIcon → .emptyStateIcon to fix a CSS specificity bug
  where the second .assistantIcon/.avatar rule overrode the empty-state
  container from 48 px down to 26 px; align the JSX size prop to 22 px
  to match the CSS .avatarLogo rule
- Show the "Generating…" status dots only while status === 'submitted'
  (waiting for first token) so they disappear once streaming text is
  visible, removing the redundant double indicator
- Remove dead searchCount JSX render and its always-hidden CSS rule
- Remove redundant max-height on .panel (height already constrains it)
- Remove dead .streamingText CSS class now that the <pre> branch is gone

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ator

- Add transformSourceUrl() to rewrite GitHub developer-portal content
  URLs to live docs page URLs via regex, e.g.
  github.com/.../developer-portal/content/en/hardware-sdk/foo.mdx
  → {origin}/en/hardware-sdk/foo
  No static mapping table needed; works across test and prod origins
  automatically via window.location.origin

- Replace status === 'submitted' streaming indicator condition with
  isWaitingForContent = isGenerating && no renderable text yet, so the
  "Generating…" dots stay visible until the first token actually renders
  in the message list, eliminating the blank gap between dot-disappear
  and text-appear during the LLM time-to-first-token window

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants