Skip to content

Conversation

@marcodejongh
Copy link
Owner

The getSetsBySlug function had overlapping matching conditions where
"Auxiliary Kickboard" could potentially match both 'aux-kicker' AND 'aux'
slugs, and similarly "Mainline Kickboard" could match both 'main-kicker'
AND 'main' slugs.

Added explicit exclusion of 'kickboard' in the 'aux' and 'main' checks to
ensure mutually exclusive matching:

  • 'aux-kicker' only matches sets with both 'auxiliary' AND 'kickboard'
  • 'aux' only matches sets with 'auxiliary' but NOT 'kickboard'
  • 'main-kicker' only matches sets with both 'mainline' AND 'kickboard'
  • 'main' only matches sets with 'mainline' but NOT 'kickboard'

This fixes the issue where selecting a fullride configuration on Kilter
homewall would result in auxiliary holds not being properly resolved from
the URL slug.

The getSetsBySlug function had overlapping matching conditions where
"Auxiliary Kickboard" could potentially match both 'aux-kicker' AND 'aux'
slugs, and similarly "Mainline Kickboard" could match both 'main-kicker'
AND 'main' slugs.

Added explicit exclusion of 'kickboard' in the 'aux' and 'main' checks to
ensure mutually exclusive matching:
- 'aux-kicker' only matches sets with both 'auxiliary' AND 'kickboard'
- 'aux' only matches sets with 'auxiliary' but NOT 'kickboard'
- 'main-kicker' only matches sets with both 'mainline' AND 'kickboard'
- 'main' only matches sets with 'mainline' but NOT 'kickboard'

This fixes the issue where selecting a fullride configuration on Kilter
homewall would result in auxiliary holds not being properly resolved from
the URL slug.
@vercel
Copy link

vercel bot commented Nov 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
boardsesh Ready Ready Preview Comment Nov 25, 2025 11:16am

Updated both URL generation (generateSetSlug) and URL parsing (getSetsBySlug)
to handle set names that use abbreviated forms like "Aux" or "Main" instead
of the full "Auxiliary" or "Mainline".

The matching now checks for:
- 'auxiliary' OR 'aux' for aux-related sets
- 'mainline' OR 'main' for main-related sets

This ensures proper matching regardless of whether the database contains
set names like "Auxiliary", "Aux", "Auxiliary Kickboard", or "Aux Kickboard".

The key fix remains: sets with 'kickboard' in the name will only match
the '-kicker' slug variants, while sets without 'kickboard' will only
match the plain 'aux' or 'main' slugs.
- Extract matchSetNameToSlugParts into separate testable module (slug-matching.ts)
- Add 90+ new test cases for matchSetNameToSlugParts covering:
  - Full name variants (Auxiliary/Mainline)
  - Abbreviated variants (Aux/Main)
  - Kickboard vs non-kickboard mutual exclusivity
  - Full ride scenarios (all 4 sets)
  - Partial selection scenarios
  - Case insensitivity
  - Whitespace handling
  - Original kilter/tension sets (bolt/screw)
  - Real-world URL scenarios

- Expand generateSetSlug tests to cover:
  - Abbreviated names (Aux/Main)
  - Mixed full and abbreviated names
  - All partial selection combinations
  - Consistent sorting behavior
  - Edge cases

This comprehensive test suite ensures the critical bug fix for auxiliary
holds rendering is properly validated and prevents regressions.
The 10x12 homewall size uses different naming for set types - some use
"kicker" instead of "kickboard". Updated both URL generation and parsing
to handle both variants:

- generateSetSlug now checks for both "kickboard" and "kicker"
- matchSetNameToSlugParts now checks for both variants
- Added comprehensive tests for all naming variations

This ensures "Aux Kicker" matches 'aux-kicker' slug just like
"Auxiliary Kickboard" does.
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.

3 participants