Skip to content

Rearrange API methods in the sidebar.#2098

Merged
bgravenorst merged 4 commits into
mainfrom
DOC-782
Jun 19, 2025
Merged

Rearrange API methods in the sidebar.#2098
bgravenorst merged 4 commits into
mainfrom
DOC-782

Conversation

@bgravenorst

@bgravenorst bgravenorst commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

Description

Add configurable method sorting to wallet API sidebar

Problem

Methods in the wallet API sidebar were not displayed in a consistent order, making it difficult for users to find specific methods.

Solution

Implemented a configurable sorting system that groups methods by prefix with configurable priorities:

  • wallet_ methods appear first (alphabetically)
  • eth_ methods appear second (alphabetically)
  • personal_ methods appear third (alphabetically)
  • web3_ methods appear fourth (alphabetically)
  • All other methods appear last (alphabetically)

Issue(s) fixed

Fixes #782

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Copilot AI review requested due to automatic review settings June 18, 2025 03:17
@bgravenorst bgravenorst requested review from a team as code owners June 18, 2025 03:17
@vercel

vercel Bot commented Jun 18, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 19, 2025 1:51am

Copilot AI 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.

Pull Request Overview

Adds a configurable sorting system for JSON-RPC methods in the wallet API sidebar so that methods are grouped and ordered by prefix priorities.

  • Introduces METHOD_SORT_PRIORITIES, METHOD_SORT_CONFIG, getMethodPrefix, and sortMethods
  • Updates prepareLinkItems and fetchAndGenerateDynamicSidebarItems to apply the sorting
  • Minor refactoring for consistent quoting and formatting

Comment thread src/plugins/plugin-json-rpc.ts Outdated
Comment thread src/plugins/plugin-json-rpc.ts Outdated
Comment thread src/plugins/plugin-json-rpc.ts Outdated
Comment thread src/plugins/plugin-json-rpc.ts Outdated
alexandratran
alexandratran previously approved these changes Jun 18, 2025
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
@bgravenorst bgravenorst merged commit 48d4a0d into main Jun 19, 2025
18 checks passed
@bgravenorst bgravenorst deleted the DOC-782 branch June 19, 2025 04:36
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.

make sidebar item positioning configurable

3 participants