Skip to content

Improve archery no-layout guidance and actionable suggestions - #3

Merged
TaylorHere merged 5 commits into
mainfrom
cursor/-bc-a1689b88-5271-4733-9b1c-df09cda0fc64-000f
Mar 17, 2026
Merged

TaylorHere merged 5 commits into
mainfrom
cursor/-bc-a1689b88-5271-4733-9b1c-df09cda0fc64-000f

Conversation

@TaylorHere

@TaylorHere TaylorHere commented Mar 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • change default target diameter from 28mm to 22mm so the initial A4 preset has a feasible strict-symmetry layout
  • add diagnoseNoLayoutReason() in shared layout logic to explain why no solution exists
  • use the shared diagnosis in both frontend status text and /api/layout failure response
  • add suggestNearbyFeasibleLayouts() to search nearby diameters and provide actionable feasible suggestions
  • when no layout is found, frontend now shows up to 3 nearby feasible parameter suggestions (with D / n / m / s)
  • add automatic correction flow after users edit layout-related fields: if current config is infeasible, the app auto-adjusts other parameters to a nearby feasible solution
    • first lower s_min to feasible upper bound (when applicable)
    • then try nearest feasible D
    • finally fallback to nearest custom page size for fixed D + s_min
  • add target appearance options in UI and export:
    • switch between 黑白靶 and 彩色靶
    • toggle 显示环分数
    • keep preview and PDF rendering consistent for both options
  • add layout quantity interaction:
    • 自动填满(最大数量) mode (current maximize behavior)
    • 指定数量(尽量接近) mode with user-entered target count
    • solver now supports both modes in shared logic, and API accepts layoutMode + desiredTargets

Why

Users were frequently seeing 无可行排布 without clear guidance. In strict equal-spacing mode, many (page, D) pairs are mathematically unsatisfiable regardless of s_min, so generic advice was misleading.

The new behavior removes trial-and-error: after changing one parameter, users are automatically brought back to a feasible layout by adjusting other parameters.

Also, users requested richer target styles and optional score labels directly on rings.

And users wanted a direct quantity control flow: either fill the page automatically, or set a target count and get the closest feasible strict-symmetry layout.

Validation

  • npm run build (TypeScript + Vite build) passed in archery/.
Open in Web Open in Cursor 

cursoragent and others added 2 commits March 17, 2026 21:35
Co-authored-by: TaylorHere <TaylorHere@users.noreply.github.com>
Co-authored-by: TaylorHere <TaylorHere@users.noreply.github.com>
@cursor cursor Bot changed the title Improve archery layout failure diagnostics and defaults Improve archery no-layout guidance and actionable suggestions Mar 17, 2026
cursoragent and others added 3 commits March 17, 2026 21:48
Co-authored-by: TaylorHere <TaylorHere@users.noreply.github.com>
Co-authored-by: TaylorHere <TaylorHere@users.noreply.github.com>
Co-authored-by: TaylorHere <TaylorHere@users.noreply.github.com>
@TaylorHere
TaylorHere marked this pull request as ready for review March 17, 2026 21:55
@TaylorHere
TaylorHere merged commit efde0d8 into main Mar 17, 2026
1 check passed
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.

2 participants