Skip to content

docs: guides section - #717

Open
hejsztynx wants to merge 7 commits into
@ksienkiewicz/docs-core-functionalitiesfrom
@ksienkiewicz/docs-guides
Open

docs: guides section#717
hejsztynx wants to merge 7 commits into
@ksienkiewicz/docs-core-functionalitiesfrom
@ksienkiewicz/docs-guides

Conversation

@hejsztynx

Copy link
Copy Markdown
Collaborator

Summary

Added the Guides section to the docs. Aside from basic tutorials that taught general features in the Rich text formatting section, this section present 3 tutorials:

  • building user and channel mentions - similarly as it is in the main example app in the repo
  • building an emoji picker using mentions - shows that mentions are pretty powerful and can be used in more interesting situations
  • contextMenuItems - no live demo, as it is not available on web

I tested the same code in an RN app - everything works nicely, the code is portable

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Guides section to the Docusaurus docs with interactive/tutorial-style pages demonstrating more complete, real-world patterns (mentions pickers, emoji picker via mentions, and native context menu customization), replacing placeholder guide pages.

Changes:

  • Added two new interactive example components for guides: user/channel mention picker and emoji picker.
  • Added new MDX guide pages for user/channel mentions and emojis, wired to live interactive examples (Preview/Code).
  • Replaced the placeholder “Custom context menu” page with a full native-only guide and removed other placeholder guide stubs.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/src/examples/MentionOnlyEditor.tsx New interactive example implementing @/# mention pickers for the Guides section.
docs/src/examples/EmojiEditor.tsx New interactive example implementing an emoji picker using mention mechanics (:).
docs/docs/guides/user-and-channel-mentions.mdx New guide page explaining how to build user/channel mentions with a picker + live example embed.
docs/docs/guides/emojis.mdx New guide page explaining emoji insertion via mentions + live example embed.
docs/docs/guides/custom-context-menu.md Replaced placeholder with a full guide and example snippet for contextMenuItems (native-only).
docs/docs/guides/mention-only-input.md Removed placeholder stub page.
docs/docs/guides/emojis.md Removed placeholder stub page (replaced by .mdx).
docs/docs/guides/chat-input-with-images.md Removed placeholder stub page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/docs/guides/emojis.mdx Outdated
Comment thread docs/docs/guides/custom-context-menu.md Outdated
Comment thread docs/docs/guides/custom-context-menu.md
Comment thread docs/docs/guides/user-and-channel-mentions.mdx
Comment thread docs/docs/guides/emojis.mdx Outdated
Comment thread docs/docs/guides/emojis.mdx Outdated
Comment thread docs/docs/guides/emojis.mdx Outdated

@kacperzolkiewski kacperzolkiewski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, just three small suggestions

Comment thread docs/docs/guides/custom-context-menu.md Outdated
Comment thread docs/docs/guides/emojis.mdx Outdated
Comment thread docs/docs/guides/user-and-channel-mentions.mdx Outdated

@szydlovsky szydlovsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a super small comment

Comment thread docs/docs/guides/user-and-channel-mentions.mdx Outdated
hejsztynx and others added 7 commits August 11, 2026 12:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Kacper Żółkiewski <74975508+kacperzolkiewski@users.noreply.github.com>
Co-authored-by: Kacper Żółkiewski <74975508+kacperzolkiewski@users.noreply.github.com>
Co-authored-by: Mikołaj Szydłowski <9szydlowski9@gmail.com>
@hejsztynx
hejsztynx force-pushed the @ksienkiewicz/docs-guides branch from 19caac3 to 89bb38f Compare August 11, 2026 10:24

@exploIF exploIF left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is dope 🔥

// `onPress` fires - so `setMention` would do nothing. Preventing the default
// mousedown keeps focus in the editor. It's a no-op on native, where tapping a
// Pressable never steals focus.
const keepEditorFocused: any =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please provide correct types, any should be avoided

];

// Each mention kind is styled by its indicator.
const htmlStyle: HtmlStyle = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you move it below component definition, so it sits next to component styles?


export default function App() {
const ref = useRef<EnrichedTextInputInstance>(null);
// The indicator of the mention being edited ('@' | '#'), or null when idle.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doesn't give any value imo, code is self explanatory

Suggested change
// The indicator of the mention being edited ('@' | '#'), or null when idle.

Comment on lines +60 to +61
const q = query.toLowerCase();
return source.filter(item => item.name.toLowerCase().startsWith(q));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const q = query.toLowerCase();
return source.filter(item => item.name.toLowerCase().startsWith(q));
return source.filter(item => item.name.toLowerCase().startsWith(q.toLowerCase()));

Comment on lines +92 to +95
onChangeMention={({ indicator: ind, text }: OnChangeMentionEvent) => {
setIndicator(ind);
setQuery(text);
}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's create a separate function for this logic

Comment on lines +89 to +93
:::info

If you want to see the whole code used to build this example, you can find it by switching the tab from `Preview` to `Code`.

:::

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't need this explanation, we already have those snippets everywhere in the docs, so user should be familiar with that.

Suggested change
:::info
If you want to see the whole code used to build this example, you can find it by switching the tab from `Preview` to `Code`.
:::

Comment on lines +81 to +85
:::info

If you want to see the whole code used to build this example, you can find it by switching the tab from `Preview` to `Code`.

:::

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, I think it's redundant


const hasRangedSelection = !!selection && selection.start !== selection.end;

const contextMenuItems: ContextMenuItem[] = useMemo(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think useMemo can be omitted. It's just a snippet, what's more nowadays most project should already use react-compiler and manual memoization can be redundant


:::info

This is a **native-only** feature (iOS and Android) - which

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we add a video/gif then?

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.

5 participants