Add static "My Spy Code" site, update 客戶.html and README, and add GitHub Pages workflow - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd34383509
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| let decoded = chars.join(''); | ||
| decoded = decoded.replace(/:([a-z0-9\- ]+):/gi, '[$1]'); |
There was a problem hiding this comment.
Stop rewriting literal :name: text during decode
The decoder currently applies decoded.replace(/:([a-z0-9\- ]+):/gi, '[$1]') to every message, so normal plaintext like :abc: is not round-tripped and comes back as [abc] after encode/decode. This silently corrupts user content that uses colon-delimited tokens (emoji shortcodes, labels, or markdown-like text), even when no emoji preprocessing was intended.
Useful? React with 👍 / 👎.
| const graphemes = [...text]; | ||
| return graphemes.map(ch => isLikelyEmoji(ch) ? `:${emojiToName(ch)}:` : ch).join(''); |
There was a problem hiding this comment.
Segment emoji as graphemes before name preprocessing
preprocessEmojiToEnglishName uses [...text], which iterates Unicode code points rather than full grapheme clusters, so multi-codepoint emoji (for example ❤️) are split and no longer match EMOJI_NAME_MAP. This produces inconsistent placeholders and leaves artifacts (e.g., a trailing variation selector) in decrypted output, breaking the advertised emoji handling for common emoji sequences.
Useful? React with 👍 / 👎.
Motivation
main/masterusing GitHub Actions.Description
/.github/workflows/pages.ymlthat configures and deploys the repository to GitHub Pages usingactions/configure-pages,actions/upload-pages-artifact, andactions/deploy-pageson pushes tomain/masterand on manual dispatch.index.htmlcontaining the full static UI and client-side JavaScript implementing the custom encoding/decoding logic, emoji preprocessing, a codebook, share/copy buttons, and UI/UX styles.客戶.htmlto embed the same static "My Spy Code" app (the previous review form and its scripts/styles were removed and replaced by the new app content).README.mdwith instructions (in Chinese) for enabling GitHub Pages and the expected URL format, and mention thatindex.htmlis synchronized from客戶.html.Testing
Codex Task