Skip to content

🔗 feat: Link Custom Artifact Mode to Its Instructions Guide - #17021

Open
danny-avila wants to merge 1 commit into
devfrom
danny-avila/artifacts-custom-docs-link
Open

danny-avila wants to merge 1 commit into
devfrom
danny-avila/artifacts-custom-docs-link

Conversation

@danny-avila

@danny-avila danny-avila commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

The Artifacts tool in the agent builder has a Custom mode that keeps artifact rendering on but injects none of LibreChat's artifact instructions. Its info text told users to "write your own" instructions without saying what those instructions need to contain, so someone picking Custom had no way to learn the :::artifact{identifier type title} syntax, the supported types, or the React runtime's import list, and their agent quietly stopped producing artifacts.

This PR adds a Learn more link to the Custom mode info that opens the new Custom Instructions section of the artifacts docs in a new tab, and rewords the info to say that the agent's instructions must teach the artifact syntax and the types it may use. Normal and shadcn/ui modes are unchanged.

The link points to https://www.librechat.ai/docs/features/artifacts#custom-instructions. That anchor is added by LibreChat-AI/docs#825, which is not merged yet: until it is, the link opens the existing artifacts page without the section. That PR documents the three modes, the artifact syntax, each supported type's requirements (verified against the current renderer), the React runtime's available imports and shadcn/ui paths, and a copy-paste minimal template derived from the built-in prompt.

How it works

Each entry in ARTIFACT_MODES can now carry a docs link (URL plus a localized accessible-name key); only Custom sets one. ArtifactsConfig renders it inline after the active mode's info text:

<a
  href={active.docs.url}
  target="_blank"
  rel="noopener noreferrer"
  aria-label={localize(active.docs.labelKey)}
  className="text-link hover:text-link-hover underline"
>
  {localize('com_ui_learn_more')}
</a>

The visible text is "Learn more"; the accessible name is "Learn more about writing custom artifact instructions (opens in a new tab)", which starts with the visible label. The anchor follows the existing doc-link pattern in the agent builder (SidePanel/Agents/Search/InputSection.tsx), using the semantic text-link / text-link-hover roles.

New English keys: com_ui_learn_more, com_ui_artifacts_mode_custom_docs. Updated: com_ui_artifacts_mode_custom_info.

Type of change

  • Feature

Testing

  1. Open the agent builder, add the Artifacts tool and open its settings.
  2. Select Custom: the info text ends with a Learn more link that opens the artifacts docs at #custom-instructions in a new tab.
  3. Select Normal or shadcn/ui: no link is shown.

Tested environments/configuration:

  • Local dev build of this branch (Vite dev server + backend on local MongoDB), Chromium.

Automated tests:

  • BuiltinSection.spec.tsx: Custom renders the link with the docs href, target="_blank", rel="noopener noreferrer", the localized accessible name and visible text, inside the info paragraph; Normal and shadcn/ui render no link; switching the radio to Custom reveals it.
  • cd client && npx jest src/components/SidePanel/Agents/Tools/ItemDialog/__tests__/BuiltinSection.spec.tsx: 10 passed.
  • cd client && npm run typecheck: clean.
  • ESLint, Prettier and import sorting on the touched files: clean (pre-commit static checks passed).

Screenshots / recordings

Agent builder, Artifacts tool settings with Custom selected (dark mode; no color or theme changes, the link uses the existing text-link role).

Before (dev) After (this branch)
Before After

Risk / compatibility

None. Client-only copy and a static external link; no API, schema or configuration changes.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published
  • Required documentation PR: 📝 docs: Document Custom Artifact Instructions docs#825 (open, not merged)

artifacts-custom-before

artifacts-custom-after

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Pass 1 of 3 on head 4769a9c.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T13:53:57.414407Z 4769a9c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4769a9c851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

const ARTIFACTS_CUSTOM_DOCS_URL =
'https://www.librechat.ai/docs/features/artifacts#custom-instructions';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point the link at an existing docs anchor

When a user selects Custom and clicks “Learn more,” the #custom-instructions fragment has no matching heading or anchor in the current Artifacts documentation, so the browser opens the top of the page instead of the relevant guidance. The Custom-mode text currently lives under #enable-artifacts-for-an-agent; target that section or add the intended anchor to the docs before shipping this link.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this one. The #custom-instructions anchor is added by the companion docs PR, LibreChat-AI/docs#825 (## Custom Instructions on features/artifacts), and that section is the guidance this link exists to reach. Pointing at #enable-artifacts-for-an-agent would land on the one-line mode list that left users stuck in the first place, and would need a second client change once the docs merge. The docs PR is meant to merge first; until it does, the fragment simply resolves to the top of the same artifacts page, so the link is never broken. The PR description states this dependency.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Pass 2 of 3 on head 4769a9c.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 4769a9c851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

This is the final review for this PR (pass 3 of 3) of head 4769a9c. Please flag only blocking issues: correctness, security, or data loss.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Frontend UI codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 12, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 4769a9c851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Frontend UI codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant