-
-
Notifications
You must be signed in to change notification settings - Fork 0
Mobile-first rewrite of index.html, add static smoke test, update Pages workflow and README #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Huỳnh Thương (Huynhthuongg)
wants to merge
6
commits into
main
Choose a base branch
from
codex/review-code-and-propose-fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8af84b4
Optimize RKIX3 mobile web interface
Huynhthuongg bb5e175
Fix mobile route overflow
Huynhthuongg 6f2d6e9
Update index.html
Huynhthuongg f7b2c3d
Update .github/workflows/generator-generic-ossf-slsa3-publish.yml
Huynhthuongg bd9e9da
Update .github/workflows/google.yml
Huynhthuongg 45b6bbf
Update CNAME
Huynhthuongg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| app.github.rkix | ||
| app.rkix.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; | ||
| import { tmpdir } from 'node:os'; | ||
| import { join } from 'node:path'; | ||
| import { spawnSync } from 'node:child_process'; | ||
|
|
||
| const html = readFileSync('index.html', 'utf8'); | ||
| const failures = []; | ||
|
|
||
| function assert(condition, message) { | ||
| if (!condition) failures.push(message); | ||
| } | ||
|
|
||
| assert(html.includes('<!DOCTYPE html>'), 'index.html must declare an HTML doctype.'); | ||
| assert(html.includes('<section id="home"'), 'index.html must include the home route container.'); | ||
| assert(html.includes('<section id="ai"'), 'index.html must include the AI workspace route container.'); | ||
| assert(html.includes('<section id="workspace"'), 'index.html must include the workspace route container.'); | ||
| assert(html.includes('<section id="code"'), 'index.html must include the code route container.'); | ||
| assert(html.includes('<section id="profile"'), 'index.html must include the profile route container.'); | ||
| assert(html.includes('overflow-x: clip') || html.includes('overflow-x: hidden'), 'Mobile layout must explicitly prevent horizontal overflow.'); | ||
| assert(html.includes('id="chatInput"'), 'AI workspace must expose the chat input.'); | ||
| assert(html.includes('id="sendChat"'), 'AI workspace must expose the send button.'); | ||
| assert(html.includes('esc(m.text)'), 'Chat messages must be escaped before rendering into innerHTML.'); | ||
| assert(!html.includes('<p>${m.text}</p>'), 'Chat messages must not render raw user text into innerHTML.'); | ||
|
|
||
| const scripts = [...html.matchAll(/<script(?:\s[^>]*)?>([\s\S]*?)<\/script>/gi)].map((match) => match[1]); | ||
| assert(scripts.length > 0, 'index.html must include an inline script to validate.'); | ||
|
|
||
| if (scripts.length > 0) { | ||
| const workDir = mkdtempSync(join(tmpdir(), 'rkix3-smoke-')); | ||
| const scriptPath = join(workDir, 'index-inline-script.js'); | ||
| writeFileSync(scriptPath, scripts.join('\n'), 'utf8'); | ||
| const result = spawnSync(process.execPath, ['--check', scriptPath], { encoding: 'utf8' }); | ||
| if (result.status !== 0) { | ||
| failures.push(`Inline JavaScript failed syntax check:\n${result.stderr || result.stdout}`); | ||
| } | ||
| rmSync(workDir, { recursive: true, force: true }); | ||
| } | ||
|
|
||
| if (failures.length > 0) { | ||
| console.error('Static smoke test failed:'); | ||
| for (const failure of failures) console.error(`- ${failure}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log('Static smoke test passed.'); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.