Skip to content

DOC-6360 command summary lists in data type pages#2888

Merged
andy-stark-redis merged 6 commits intomainfrom
DOC-6360-full-cmd-lists
Mar 13, 2026
Merged

DOC-6360 command summary lists in data type pages#2888
andy-stark-redis merged 6 commits intomainfrom
DOC-6360-full-cmd-lists

Conversation

@andy-stark-redis
Copy link
Contributor

@andy-stark-redis andy-stark-redis commented Mar 13, 2026

This replaces the existing "Basic commands" sections with a new summary foldout listing all commands for each data type.

All feedback/suggestions welcome. In particular, I've handled bitmap/bitfield by combining the groups together and showing them all on both the bitmap and bitfield pages. Maybe another way of handling this would work better?


Note

Medium Risk
Adds a new Hugo shortcode with inline JS/CSS markup that is rendered across many data-type pages; incorrect grouping/URL generation could break command navigation or page rendering site-wide.

Overview
Replaces the hand-written “Basic commands” sections on multiple data type docs with a reusable {{< command-group >}} foldout that auto-lists commands for the relevant command group (with optional link to the filtered commands reference).

Introduces a new layouts/shortcodes/command-group.html shortcode that merges command metadata sources, filters/sorts by group, and renders an expandable command list (including per-command summary/metadata). Also updates strings.md to point readers to the bitmaps/bitfields pages for bitwise/bitfield operations, and handles bitmap/bitfield by using a shared combined summary.

Written by Cursor Bugbot for commit 824c37d. This will update automatically on new commits. Configure here.

@andy-stark-redis andy-stark-redis requested review from a team and dwdougherty March 13, 2026 10:38
@andy-stark-redis andy-stark-redis self-assigned this Mar 13, 2026
@andy-stark-redis andy-stark-redis added the clients Client library docs label Mar 13, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

DOC-6360

@github-actions
Copy link
Contributor

Staging links:
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/bitfields/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/bitmaps/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/geospatial/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/hashes/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/json/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/lists/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/bloom-filter/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/count-min-sketch/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/cuckoo-filter/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/hyperloglogs/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/t-digest/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/probabilistic/top-k/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/sets/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/sorted-sets/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/streams/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/strings/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/timeseries/
https://redis.io/docs/staging/DOC-6360-full-cmd-lists/develop/data-types/vector-sets/

@jit-ci
Copy link

jit-ci bot commented Mar 13, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

content.classList.toggle('hidden');
chevron.classList.toggle('rotate-180');
}
</script>
Copy link

Choose a reason for hiding this comment

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

Script tag duplicated per shortcode instance on page

Low Severity

The toggleCommandGroup function is defined inside a <script> tag within the shortcode template. Since this shortcode is rendered inline, every usage emits a duplicate <script> block into the page HTML. The bitmap and bitfield pages each only use it once currently, but the design means any page using multiple command-group shortcodes would get redundant global function definitions. This function belongs in a shared JS file or needs a guard to avoid re-declaration.

Fix in Cursor Fix in Web

Copy link
Collaborator

@dwdougherty dwdougherty left a comment

Choose a reason for hiding this comment

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

Just one bug for the vector set group. Otherwise, this looks great, @andy-stark-redis! I'm very happy with this.

One nitpick (maybe unfixable) is that sometimes, the right side navigation menu takes a second or two to appear, and when it does, it's a bit jarring.

weight: 55
---

{{< command-group group="module" title="Vector set command summary" show_link=true >}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
{{< command-group group="module" title="Vector set command summary" show_link=true >}}
{{< command-group group="vector_set" title="Vector set command summary" show_link=true >}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dwdougherty I'm not sure I understand this. Vector sets do have a group name of "module" in commands_core.json:

"VADD": {
        "summary": "Add one or more elements to a vector set, or update its vector if it already exists",
        "since": "8.0.0",
        "group": "module",
        "arity": -5,
        "key_specs": [
...

...but then they have "module": "vectorset" defined in the same command entry at the end. Is the vector_set group to the command pages' Markdown frontmatter manually?

Copy link
Collaborator

@dwdougherty dwdougherty Mar 13, 2026

Choose a reason for hiding this comment

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

I didn't understand it at first either; it's pretty convoluted.

I added the vector set commands using the entries in this file. The group "module" thing is an idiosyncrasy of how the module commands were added in order to support the COMMAND DOCS command. You would've seen the same thing with the other module commands, but I strip them out of the commands_core.json file before writing the file in place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dwdougherty I've added an override option for when the group name in commands_core.json isn't the same as the group name in the URL. Main thing is that the vector set command ref link works correctly now.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

{{ $sortedCommands := sort $matchedCommands "name" }}

{{/* Generate unique ID for this instance */}}
{{ $uniqueId := printf "cmd-group-%s-%d" $groupLower (now.UnixNano) }}
Copy link

Choose a reason for hiding this comment

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

Non-deterministic HTML output from now.UnixNano in IDs

Medium Severity

Using now.UnixNano to generate the unique element ID means every Hugo build produces different HTML output, even when content hasn't changed. This breaks Hugo's build caching, causes unnecessary diffs in version control, and can defeat CDN or deployment-layer caching that relies on content hashing. Since each page currently only has one command-group instance, the $groupLower value alone would already be unique within a page — the timestamp adds no uniqueness benefit while introducing non-determinism.

Fix in Cursor Fix in Web

{{ . }}
</span>
{{ end }}
{{ end }}
Copy link

Choose a reason for hiding this comment

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

Raw ACL categories displayed as user-facing tags

Medium Severity

The shortcode renders every entry from acl_categories (e.g., @write, @string, @slow, @fast) as visible badge tags next to each command name. These are internal Redis ACL category markers not intended for end-user documentation display. With most commands having 2–4 categories, this significantly clutters each command row in the foldout, obscuring the useful information like command name, version, and summary.

Fix in Cursor Fix in Web

@andy-stark-redis
Copy link
Contributor Author

Thanks @dwdougherty !

@andy-stark-redis andy-stark-redis merged commit 40d42b4 into main Mar 13, 2026
47 checks passed
@andy-stark-redis andy-stark-redis deleted the DOC-6360-full-cmd-lists branch March 13, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants