Commit 21776a3
authored
Inline submit — no page navigation, everything in background (#5)
* Replace redirect flow with inline submit via Cloudflare Worker
The previous flow took users off the page to a GitHub issue form.
Now everything happens in the background:
1. User pastes URL, clicks Request
2. Frontend POSTs to /api/request (Cloudflare Worker)
3. Worker creates the GitHub issue (triggers auto-add pipeline)
4. User sees inline success message with their docs link
Changes:
- Add worker/ with Cloudflare Worker that proxies to GitHub Issues API
- Rewrite frontend JS to use fetch() with loading/success/error states
- Remove nav "Request a Repo" button (the inline form is the entry point)
- Remove .request-btn CSS, add .submit-feedback state classes
Worker deployment:
cd worker && npx wrangler secret put GITHUB_TOKEN
npx wrangler deploy
Route repos.supermodeltools.com/api/* to the worker in Cloudflare.
* Redirect to loading page after Generate, auto-refresh when docs ready
UX flow:
1. User pastes URL, clicks "Generate" (renamed from Request)
2. API fires in background, user is redirected to the docs URL
3. Since docs aren't deployed yet, GitHub Pages serves 404.html
4. 404.html detects the repo path and shows a loading page:
- Supermodel eye logo with scanning animation
- Animated progress steps (Forking → Analyzing → Building → Deploying)
- Polls the URL every 5s for up to 10 minutes
5. When docs deploy, poll detects real content and page auto-reloads
6. User sees the full architecture docs
For genuine 404s (not repo paths), shows a standard 404 page.
Changes:
- generate-index.go: add generate404() + notFoundTemplate
- Rename "Request" → "Generate" in button text
- Frontend JS redirects to docs_url after successful API call
- 404.html: loading animation, step progress, polling logic
* Skeleton loading page instead of 404 — no 404 ever shown
After clicking Generate, the user lands on /generating/{name} which
is served by the Cloudflare Worker as a real 200 page. It mirrors
the actual arch-docs layout with shimmer placeholders:
- Same header with repo name, nav links, "All Repos" back link
- Skeleton hero with shimmer stat counters
- Skeleton chart panels (Architecture Overview, Composition)
- Skeleton taxonomy grids (Node Types, Domains, Languages)
- Floating status bar: "Generating docs — analyzing codebase..."
The status bar cycles through stages (forking, analyzing, building
graphs, mapping architecture, deploying) on realistic timers.
Polls the real docs URL every 5s. When docs are ready, the status
bar flashes "Ready!" and redirects to the real page.
The user sees what the page WILL look like, never sees a 404,
and is seamlessly transitioned to the real docs when ready.
Also:
- Renamed "Request" → "Generate" everywhere
- 404.html now just redirects to homepage (for genuine broken links)1 parent 676f876 commit 21776a3
3 files changed
+506
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
62 | 67 | | |
63 | 68 | | |
64 | 69 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
74 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
196 | 208 | | |
197 | 209 | | |
198 | 210 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
400 | 404 | | |
401 | | - | |
402 | 405 | | |
403 | 406 | | |
404 | 407 | | |
405 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
406 | 413 | | |
407 | 414 | | |
408 | 415 | | |
| |||
432 | 439 | | |
433 | 440 | | |
434 | 441 | | |
435 | | - | |
436 | 442 | | |
437 | 443 | | |
438 | 444 | | |
| |||
462 | 468 | | |
463 | 469 | | |
464 | 470 | | |
465 | | - | |
| 471 | + | |
466 | 472 | | |
467 | | - | |
| 473 | + | |
468 | 474 | | |
469 | 475 | | |
470 | 476 | | |
| |||
510 | 516 | | |
511 | 517 | | |
512 | 518 | | |
513 | | - | |
| 519 | + | |
514 | 520 | | |
515 | 521 | | |
516 | | - | |
| 522 | + | |
517 | 523 | | |
518 | 524 | | |
519 | 525 | | |
| |||
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
549 | 560 | | |
550 | 561 | | |
551 | 562 | | |
552 | 563 | | |
553 | | - | |
554 | | - | |
| 564 | + | |
555 | 565 | | |
556 | 566 | | |
557 | | - | |
| 567 | + | |
558 | 568 | | |
559 | 569 | | |
560 | 570 | | |
561 | 571 | | |
562 | | - | |
| 572 | + | |
563 | 573 | | |
564 | 574 | | |
| 575 | + | |
565 | 576 | | |
566 | 577 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
571 | 606 | | |
572 | 607 | | |
573 | 608 | | |
574 | 609 | | |
575 | | - | |
| 610 | + | |
576 | 611 | | |
577 | 612 | | |
578 | | - | |
| 613 | + | |
579 | 614 | | |
580 | 615 | | |
581 | 616 | | |
| |||
588 | 623 | | |
589 | 624 | | |
590 | 625 | | |
| 626 | + | |
0 commit comments