Skip to content

Conversation

ccmao1130
Copy link
Contributor

Changes Made

remove versions before v0.5 in the selector

Related Issues

Checklist

  • Documented in API Docs (if applicable)
  • Documented in User Guide (if applicable)
  • If adding a new documentation page, doc is added to docs/mkdocs.yml navigation
  • Documentation builds and is formatted properly (tag @/ccmao1130 for docs review)

@github-actions github-actions bot added the docs label Aug 29, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR modifies the documentation version selector dropdown to hide older versions (v0.0.* through v0.4.) from being displayed to users, only showing v0.5. and later versions. The change is implemented in docs/js/readthedocs.js by adding a JavaScript filter function that checks version slugs using string prefix matching.

The implementation adds filtering logic to the existing version selector template, where config.versions.active is filtered before being mapped to HTML options. The filter function uses a series of startsWith() checks to identify and exclude versions with prefixes v0.0., v0.1., v0.2., v0.3., and v0.4., returning false for these matches and true for all other versions.

This change fits into the broader documentation infrastructure of the Daft project, which uses MkDocs for documentation generation and Read the Docs for hosting. The modification affects only the UI presentation layer - the underlying version data remains unchanged, preserving the ability to access older versions directly via URL if needed. This is a common practice in open-source projects to reduce cognitive load on users by hiding legacy or unsupported versions from the primary navigation interface.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it only affects documentation UI presentation
  • Score reflects simple string matching logic with potential edge cases around non-standard version formats
  • Pay close attention to version string format assumptions in the filtering logic

1 file reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Comment on lines +19 to +29
.filter((version) => {
// Hide versions from v0.0.0 to v0.4.*, only show v0.5.* and later
const versionSlug = version.slug;
if (versionSlug.startsWith('v0.0.') ||
versionSlug.startsWith('v0.1.') ||
versionSlug.startsWith('v0.2.') ||
versionSlug.startsWith('v0.3.') ||
versionSlug.startsWith('v0.4.')) {
return false;
}
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The version filtering logic assumes all versions follow the 'v{major}.{minor}.' format. Consider what happens with versions like 'latest', 'dev', or 'v1.0' (without patch number) - they would pass through this filter unexpectedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant