Skip to content

fix(toolbar): remove search-switch divider before rightSlot - #20

Merged
jansaldo merged 1 commit into
mainfrom
fix/toolbar-search-switch-divider
Jul 16, 2026
Merged

fix(toolbar): remove search-switch divider before rightSlot#20
jansaldo merged 1 commit into
mainfrom
fix/toolbar-search-switch-divider

Conversation

@jansaldo

@jansaldo jansaldo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the vertical divider Toolbar was rendering between the search box and rightSlot in the search-switch context — found while integrating v0.4.2 into desktop-app's Voz a Texto edit screen.

Figma node 40002322-57362 (base search-switch toolbar) shows the search box and "Modo Edición" switch with plain empty space between them, no divider line. The component's own doc comment already only describes a divider for anonimizador/set-de-datos ("Search (wide) + vertical divider + ...", "Search + vertical divider + ..."); the search-switch line never mentioned one ("Search (wide) + Switch+label"), confirming it was never intended there.

One-line conditional gate ({!isSearchSwitch && <ToolbarDivider />}), following the exact same isSearchSwitch pattern already used in this file for the search-width fix (PR #19). No new component, no API change.

Compatibility

  • No exported prop/type changes on ToolbarProps.
  • anonimizador/set-de-datos untouched — both still render their divider.
  • Player's unrelated rightSlot prop (different component) is unaffected.

Verification

  • pnpm typecheck / pnpm biome check — pass.
  • Storybook: SearchSwitch and SearchSwitchWithResults no longer show the divider before "Modo Edición"; Anonimizador still shows its divider before the tool buttons, confirming no regression.

Summary by Sourcery

Bug Fixes:

  • Align search-switch toolbar layout with design by omitting the divider between the search box and rightSlot.

@sourcery-ai

sourcery-ai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Toolbar so that the vertical divider before the rightSlot is suppressed in the search-switch variant, while preserving the divider in other toolbar variants such as anonimizador and set-de-datos.

File-Level Changes

Change Details Files
Conditionally render the Toolbar divider before the right slot so that it is omitted for the search-switch toolbar variant.
  • Extended the rightSlot section comment to document that search-switch should not show a divider, referencing the design spec and other variants.
  • Wrapped the ToolbarDivider in a conditional using the existing isSearchSwitch flag so that the divider only renders when the toolbar is not in search-switch mode.
  • Kept the rightSlot container and flex layout intact, ensuring no behavioral or API changes beyond the visual adjustment.
src/components/toolbar/Toolbar.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • The new inline comment is quite detailed and design-specific; consider trimming it to a brief rationale and move Figma node references to a design doc or commit message to keep the component code focused.
  • Since isSearchSwitch now controls both search width and divider visibility, it might be worth extracting a small helper or clarifying naming to make its role as the "search-with-switch" mode more explicit for future maintainers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new inline comment is quite detailed and design-specific; consider trimming it to a brief rationale and move Figma node references to a design doc or commit message to keep the component code focused.
- Since `isSearchSwitch` now controls both search width and divider visibility, it might be worth extracting a small helper or clarifying naming to make its role as the "search-with-switch" mode more explicit for future maintainers.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jansaldo
jansaldo merged commit facb4d3 into main Jul 16, 2026
2 checks passed
@jansaldo
jansaldo deleted the fix/toolbar-search-switch-divider branch July 16, 2026 22:34
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.

1 participant