Skip to content

Add tools section to Boost library views and templates#2049

Open
julioest wants to merge 9 commits into
boostorg:developfrom
julioest:add-boost-tools-1810
Open

Add tools section to Boost library views and templates#2049
julioest wants to merge 9 commits into
boostorg:developfrom
julioest:add-boost-tools-1810

Conversation

@julioest

@julioest julioest commented Dec 16, 2025

Copy link
Copy Markdown
Collaborator
  • Introduced a new TOOLS constant in constants.py containing various Boost tools with descriptions and URLs.
  • Implemented a get_tools function in utils.py to retrieve and sort the tools.
  • Updated LibraryListBase to include tools in the context data for library views.
  • Enhanced categorized_list.html, grid_list.html, and vertical_list.html templates to display tools alongside libraries, with appropriate descriptions and formatting.

Summary by CodeRabbit

  • New Features

    • Added a dedicated Tools section to library listings across grid, vertical, and categorized views.
    • Introduced Boost-related documentation, build, regression, inspection, and contributor tools with descriptions and links.
    • Tool links automatically direct to the appropriate version-specific documentation when available.
    • Added responsive layouts for viewing tools on desktop and mobile devices.
  • Style

    • Simplified spacing in library view preferences.

@julioest julioest linked an issue Dec 16, 2025 that may be closed by this pull request
@julioest julioest changed the title WIP: Add tools section to Boost library views and templates Add tools section to Boost library views and templates Dec 17, 2025
@julioest julioest force-pushed the add-boost-tools-1810 branch from 596fdda to 62db6a1 Compare December 29, 2025 15:29
@julioest julioest mentioned this pull request Dec 30, 2025
@julioest julioest marked this pull request as ready for review December 30, 2025 02:03

@gregjkal gregjkal 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.

Looking good - couple of questions/suggested changes.

Comment thread libraries/constants.py Outdated
Comment thread libraries/constants.py Outdated
Comment thread libraries/utils.py
Comment thread libraries/constants.py
"slug": "build",
"description": "The Boost build system, including the full Boost version of the jam sources.",
"version_specific": True,
"url_path": "tools/build/doc/html/index.html",

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.

Have you tested these urls? I would think they should be root-relative, i.e. have a leading slash.

Suggested change
"url_path": "tools/build/doc/html/index.html",
"url_path": "/tools/build/doc/html/index.html",

julioest and others added 9 commits July 11, 2026 10:38
- Introduced a new TOOLS constant in constants.py containing various Boost tools with descriptions and URLs.
- Implemented a get_tools function in utils.py to retrieve and sort the tools.
- Updated LibraryListBase to include tools in the context data for library views.
- Enhanced categorized_list.html, grid_list.html, and vertical_list.html templates to display tools alongside libraries, with appropriate descriptions and formatting.
- Added a new tool "boostlook" to the TOOLS constant in constants.py with its description and URL.
- Modified the get_tools function in utils.py to accept an optional version parameter, allowing for dynamic URL generation for version-specific tools.
- Updated LibraryListBase and LibraryCategorized views to pass the selected version to get_tools, ensuring correct URL handling in the context data.
- Updated _tool_categorized_list_item.html, _tool_grid_list_item.html, and _tool_vertical_list_item.html to conditionally render tool URLs, allowing for clickable rows and cards.
- Simplified the display logic for tool names and descriptions, ensuring consistent styling and behavior across different list formats.
- Enhanced accessibility by adding cursor pointer styles for clickable elements.
…to the Tools section. Includes tooltip on hover.
Co-authored-by: Greg Kaleka <greg@gregkaleka.com>
Co-authored-by: Greg Kaleka <greg@gregkaleka.com>
The version_slug hoist computed version.stripped_boost_url_slug before checking whether version was set, so calling get_tools() with no version threw AttributeError. The library list view does exactly that on some paths. Only compute the slug when a version is actually present.
@julioest julioest force-pushed the add-boost-tools-1810 branch from 0fa1603 to 5082283 Compare July 11, 2026 14:46
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a structured Boost tool catalog, resolves tool URLs by version, injects tools into library views, and renders them in categorized, grid, and vertical layouts with responsive link behavior.

Changes

Tool catalog integration

Layer / File(s) Summary
Tool metadata and URL resolution
libraries/constants.py, libraries/utils.py
Defines tool metadata and produces sorted tool entries with version-specific or direct URLs.
View context and categorized results
libraries/views.py
Adds tools to list context and appends a Tools pseudo-category for categorized views.
Tool sections and item templates
templates/libraries/...
Renders tools in categorized, grid, and vertical layouts with responsive markup and conditional external links.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LibraryView
  participant get_tools
  participant Templates
  LibraryView->>get_tools: request tools for selected version
  get_tools-->>LibraryView: return sorted tools with resolved URLs
  LibraryView->>Templates: provide tools in view context
  Templates-->>LibraryView: render tool sections and items
Loading

Suggested reviewers: jlchilders11, herzog0, kattyode

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing most required template sections, including issue number, context, links, risks, screenshots, and checklist. Add the issue number, summary/context, Figma and page links, changes, risks, screenshots, and the self-review checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a Tools section to Boost library views and templates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/libraries/_tool_categorized_list_item.html`:
- Around line 1-7: Replace the URL-bearing clickable <tr> branch in the tool
list item with a normal link: render tool.name as an <a> using tool.url,
target="_blank", and rel="noopener noreferrer". Remove the inline onclick
behavior while preserving the existing non-link <tr> branch when tool.url is
empty.

In `@templates/libraries/_tool_vertical_list_item.html`:
- Around line 1-5: Update the tool.url branch of the row markup in
_tool_vertical_list_item.html to make the clickable <tr> focusable and
semantically interactive by adding appropriate tabindex and role attributes plus
a keyboard handler that activates the same window.open behavior for Enter and
Space. Apply the same accessibility fix to the corresponding clickable row in
_tool_categorized_list_item.html, while leaving rows without tool.url unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4190fc1f-30fe-4532-9577-a788e38fbb1c

📥 Commits

Reviewing files that changed from the base of the PR and between c7720d2 and 5082283.

📒 Files selected for processing (10)
  • libraries/constants.py
  • libraries/utils.py
  • libraries/views.py
  • templates/libraries/_tool_categorized_list_item.html
  • templates/libraries/_tool_grid_list_item.html
  • templates/libraries/_tool_vertical_list_item.html
  • templates/libraries/categorized_list.html
  • templates/libraries/grid_list.html
  • templates/libraries/includes/library_preferences.html
  • templates/libraries/vertical_list.html

Comment on lines +1 to +7
{% if tool.url %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-200 ease-in-out cursor-pointer" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')">
{% else %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-200 ease-in-out">
{% endif %}
<td class="py-2 align-top md:w-1/5">
<span class="mr-1 font-bold capitalize text-sky-600 dark:text-sky-300">{{ tool.name }}</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Use a real link for linked tools.

The clickable <tr> is not keyboard-accessible, provides no copyable/context-menu link, and interpolates tool.url into inline JavaScript. Render the tool name as an <a href> with target="_blank" and rel="noopener noreferrer" instead; keep the non-link branch for tools whose URL is empty.

🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/libraries/_tool_categorized_list_item.html` around lines 1 - 7,
Replace the URL-bearing clickable <tr> branch in the tool list item with a
normal link: render tool.name as an <a> using tool.url, target="_blank", and
rel="noopener noreferrer". Remove the inline onclick behavior while preserving
the existing non-link <tr> branch when tool.url is empty.

Comment on lines +1 to +5
{% if tool.url %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')">
{% else %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out">
{% endif %}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Tool rows with onclick are not keyboard-accessible.

When tool.url is set, the <tr> uses onclick to open the link but lacks tabindex, role, and a keyboard event handler. Keyboard-only users cannot focus or activate these rows, and there is no <a> fallback — this blocks task completion. The same pattern exists in _tool_categorized_list_item.html.

♿ Proposed fix: add keyboard support and ARIA semantics
 {% if tool.url %}
-  <tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')">
+  <tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer focus:outline focus:outline-2 focus:outline-sky-500" tabindex="0" role="link" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')" onkeydown="if(event.key==='Enter'){window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')}">
 {% else %}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{% if tool.url %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')">
{% else %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out">
{% endif %}
{% if tool.url %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out cursor-pointer focus:outline focus:outline-2 focus:outline-sky-500" tabindex="0" role="link" onclick="window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')" onkeydown="if(event.key==='Enter'){window.open('{{ tool.url }}', '_blank', 'noopener,noreferrer')}">
{% else %}
<tr class="border-0 md:border border-gray-200/10 border-dotted md:border-t-0 md:border-r-0 md:border-l-0 md:border-b-1 hover:bg-gray-100 dark:hover:bg-gray-700 transition-all duration-300 ease-in-out">
{% endif %}
🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/libraries/_tool_vertical_list_item.html` around lines 1 - 5, Update
the tool.url branch of the row markup in _tool_vertical_list_item.html to make
the clickable <tr> focusable and semantically interactive by adding appropriate
tabindex and role attributes plus a keyboard handler that activates the same
window.open behavior for Enter and Space. Apply the same accessibility fix to
the corresponding clickable row in _tool_categorized_list_item.html, while
leaving rows without tool.url unchanged.

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.

Boost Tools docs

2 participants