Commit 1588e32
feat(view): add viewStyle preset to paginationNav and pageNumberLinks (#2731)
* feat(view): add viewStyle preset to paginationNav and pageNumberLinks for Bootstrap markup
The viewStyle argument accepts "plain" (default), "bootstrap5", "bootstrap4", or
"tailwind". Bootstrap presets emit the canonical
<nav><ul class="pagination"><li class="page-item active" aria-current="page">
<span class="page-link">N</span></li> structure — active class on the <li>
wrapper, <span> for the current page — so Bootstrap-styled apps no longer need
a Replace() regex hack to move the active class off the anchor.
Default remains "plain" to preserve today's output byte-for-byte.
Fixes #2718
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
* docs: document viewStyle preset in CLAUDE.md pagination quick reference
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
* fix(view): address Reviewer A/B consensus findings (round 1)
- vendor/wheels/view/pagination.cfc: encode arguments.text via
EncodeForHTML when encode=true in the Bootstrap/Tailwind disabled
branches of $renderPaginationNavLink. Previously local.encode was
resolved but ignored, causing custom HTML-entity nav text (e.g.
«) to render literally in the preset path while being
decoded in the plain path.
- vendor/wheels/tests/specs/view/paginationHelpersSpec.cfc: replace
the weak Tailwind pageNumberLinks assertion (which passed even if
Bootstrap markup was accidentally emitted) with Tailwind-specific
class assertions (pagination-current, pagination-link), plus
paginationNav coverage for viewStyle="bootstrap4" (active class on
<li>, no aria-current) and viewStyle="tailwind" (flat
<nav class="pagination"> with no <ul>, pagination-disabled spans
on first page), and a showInfo=true positioning spec for
Bootstrap 5.
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
* fix(view): throw Wheels.InvalidViewStyle on unknown viewStyle (round 2)
Reviewer A flagged in round 2 that the three internal $renderPagination*
helpers silently emit structurally broken HTML when handed an unknown
viewStyle value (e.g. a typo like "boostrap5"). The call-site guard
`local.useViewStyle = Len(arguments.viewStyle) && arguments.viewStyle
!= "plain"` already filters out the empty/plain case, so reaching the
default branch is by definition a developer typo. Replace the silent
fallbacks with a Wheels.InvalidViewStyle throw so the failure is loud
and immediate at development time instead of surfacing as garbled output.
Specs cover both the pageNumberLinks() and paginationNav() public entry
points, asserting the typed throw using the existing toThrow matcher
pattern from assetsSpec/viteSpec.
Round-2 carry-over per Reviewer A; round-1 address-review intentionally
skipped this per Reviewer B's "nice-to-have" classification, but
Reviewer A held it open as still required.
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
* docs: list bootstrap4 and tailwind under paginationNav too
Reviewer A's round-2 docs nit: the CLAUDE.md "Pagination View Helpers"
quick reference showed paginationNav with bootstrap5 only, while
bootstrap4 and tailwind appeared only under pageNumberLinks. Both
presets are equally valid on both helpers, so add the paginationNav
companion lines for the two missing presets.
Signed-off-by: Peter Amiri <peter@alurium.com>
* docs: extend viewStyle ignore list with prepend/append/anchorDivider
Reviewer A round-6 docs gap: the CLAUDE.md "Non-plain presets ignore..."
list was written before PR #2730 added prepend/append/anchorDivider
args. Those args also land in local.skipArgs and are NOT forwarded into
$renderPaginationNav(), so the preset path silently drops them. Add the
three names to the explicit ignore list so anyone reading the docs
sequentially sees the full picture.
Signed-off-by: Peter Amiri <peter@alurium.com>
---------
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Signed-off-by: Peter Amiri <peter@alurium.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Peter Amiri <peter@alurium.com>1 parent 5a4a299 commit 1588e32
5 files changed
Lines changed: 390 additions & 3 deletions
File tree
- vendor/wheels
- events/init
- tests/specs/view
- view
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
474 | 486 | | |
475 | 487 | | |
476 | 488 | | |
| |||
492 | 504 | | |
493 | 505 | | |
494 | 506 | | |
495 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
496 | 510 | | |
497 | 511 | | |
498 | 512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
| 311 | + | |
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
| |||
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
| 322 | + | |
321 | 323 | | |
322 | 324 | | |
323 | 325 | | |
| |||
Lines changed: 141 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
228 | 369 | | |
229 | 370 | | |
230 | 371 | | |
| |||
0 commit comments