添加移动端 Codex 入门教程 Web App(5 章,面向业务同学)#1
Conversation
| }, 1500); | ||
| } catch { | ||
| copyBtn.textContent = '复制失败,请手动复制'; | ||
| } |
There was a problem hiding this comment.
Copy failure state never resets button text
Medium Severity
The catch block sets copyBtn.textContent to the failure message but never resets it back to '复制模板', unlike the success path which uses setTimeout to restore the original label after 1500ms. On mobile browsers, navigator.clipboard.writeText frequently fails (non-HTTPS contexts, missing permissions, lack of user activation), so users are likely to encounter a permanently stuck error label with no visual indication they can retry.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: '.' |
There was a problem hiding this comment.
Deployment exposes unrelated scraper script to public Pages
High Severity
The path: '.' setting in the upload artifact step deploys the entire repository root to GitHub Pages, including the pre-existing spider file — a Python web scraper that contains hardcoded target URLs and a spoofed Baiduspider User-Agent header. This makes the scraper source publicly accessible on the deployed site, exposing implementation details that likely weren't intended to be published.
| const target = document.getElementById(btn.dataset.target); | ||
| if (target) { | ||
| target.classList.add('active'); | ||
| target.scrollIntoView({ behavior: 'smooth', block: 'start' }); |
There was a problem hiding this comment.
scrollIntoView hides chapter heading behind sticky nav
Medium Severity
scrollIntoView({ block: 'start' }) aligns the chapter section's top edge with the viewport top, but .chapter-nav is position: sticky; top: 0 with no corresponding scroll-margin-top on .chapter sections. The sticky nav (~50px tall) covers the <h2> heading of whichever chapter the user navigates to, hiding the primary content the user just selected.


Motivation
Description
index.html,构建单页教程型 Web App,包含 5 个章节并嵌入 SVG 插画、时间线、流程图、表格、卡片等可视化元素。styles.css,实现移动优先响应式布局与卡片、导航、提示框等视觉组件样式。script.js,实现章节切换的 Tab 行为和平滑滚动,以及“复制提示词模板”的一键复制与成功/失败反馈。Testing
node --check script.js验证了脚本语法并通过。Codex Task
Note
Medium Risk
Adds a GitHub Actions workflow with
pages:writeandid-token:writepermissions to auto-deploy the repository root to GitHub Pages; misconfiguration could unintentionally publish content. The rest is static HTML/CSS/JS with minimal runtime risk.Overview
Adds a mobile-first, single-page Codex onboarding tutorial web app (
index.html,styles.css,script.js) with 5 chapters, tab-style chapter navigation, and a one-click “copy prompt template” interaction.Enables publishing the static site to GitHub Pages by adding an automated deployment workflow (
.github/workflows/deploy-pages.yml) and updatingREADME.mdwith local preview and Pages deployment instructions.Written by Cursor Bugbot for commit e8b8c96. This will update automatically on new commits. Configure here.