https://chromewebstore.google.com/detail/gemini-voyager/kjdpnimcnfinmilocccippmododhceol?…
- User
https://chromewebstore.google.com/detail/gemini-voyager/kjdpnimcnfinmilocccippmododhceol?hl=zh 我希望更新版本的弹窗里会有一个检测到如果用户是 chrome 的话,就多一个优美的提示,表达欢迎去谷歌商店评价。后面那个language要根据用户选择的语言进行拼接。
Assistant
Now let me check the translations and browser utility:
Assistant
Now let me check the English messages.json for existing keys and the CSS styles:
Assistant
Now let me check the changelog CSS styles and the other locale files to understand the structure:
Assistant
Let me check a few locale files to confirm their ending structure:
Assistant
Now I have everything I need. Let me implement this in parallel:
Assistant
Step 1: Add
isChrome()to browser.tsAssistant
Step 2: Add translation keys to all 10 locale files in parallel
Assistant
All confirmed. Now edit all 9 remaining locale files in parallel:
Assistant
Step 3: Update
changelog/index.tsto add Chrome detection and render the rating banner:Assistant
Now add the Chrome Store URL helper and the rating banner to
createChangelogModal:Assistant
Now insert the Chrome rating banner inside
createChangelogModal, right before the action row:Assistant
Step 4: Add CSS styles to
contentStyle.css. Let me find the right insertion point:Assistant
Now run typecheck to verify everything is correct:
Assistant
Clean. Let me do a quick verify of the final state of the changelog index:
Assistant
Everything looks correct. Let me also verify the
prompt/index.tshas no issues (it was also in the git status as modified):Assistant
All 9 tests pass.
Assistant
完成了!以下是所有改动的总结:
改动内容
src/core/utils/browser.ts
新增isChrome()函数,检测当前浏览器是 Chrome(排除 Edge、Firefox、Safari)。src/pages/content/changelog/index.ts- 引入
isChrome - 定义
CHROME_STORE_URL常量(指向你的扩展页面) - 在
createChangelogModal里,仅当isChrome()为true时,在推荐语下方、底部按钮行上方,插入一个评分横幅:- 左侧:当前语言的提示文字
- 右侧:
⭐ 立即评分链接按钮,点击跳转 Chrome Web Store
public/contentStyle.css
新增.gv-changelog-chrome-rating等样式:- 浅蓝→淡紫渐变背景(暗色模式自动适配)
- 圆角卡片 + 细边框
- 蓝色胶囊按钮,hover 变深
所有 10 个语言文件(
en/zh/zh_TW/ja/ko/fr/es/pt/ar/ru)
新增changelog_rate_chrome(提示语)和changelog_rate_chrome_cta(按钮文字)两个翻译 key,均已本地化。效果示意(Chrome 用户看到的 footer):
code如果 Voyager 对你有帮助,欢迎推荐给朋友… ┌─────────────────────────────────────────────┐ │ 觉得 Gemini Voyager 好用吗?… │ ⭐ 立即评分 └─────────────────────────────────────────────┘ ❤️ GitHub 详细功能见文档 → [ Got it ]- 引入
- User
弹窗里的图片都提供点击后放大预览的效果,鼠标放在图片上光标也会变
Assistant
Let me check the changelog overlay's z-index first, then implement:
Assistant
The overlay uses
z-index: 2147483647(max). The lightbox appended todocument.bodyafter the overlay will naturally stack on top at the same z-index due to DOM order. Now let's implement:Assistant
Good. Now I'll add the lightbox helper and the image click binding in one edit:
Assistant
Now bind click events to images after setting
body.innerHTML:Assistant
Now add the CSS — cursor on hover, lightbox overlay, and image style:
Assistant
Now add the lightbox CSS at the end of the changelog section:
Assistant
Run typecheck to confirm no errors:
Assistant
Clean. Let me do a final review of the key part of the changelog file:
Assistant
完成。改动如下:
改动内容
src/pages/content/changelog/index.ts新增
showImageLightbox(src, alt)函数:- 创建全屏暗色遮罩 + 居中放大图片
- 点击任意位置关闭
- 按
Esc也可关闭 - 事件监听器在关闭时自动清理
在
createChangelogModal中,设置完body.innerHTML后,遍历所有img元素绑定点击事件。public/contentStyle.css.gv-changelog-body img— 新增cursor: zoom-in,hover 时轻微降低透明度(视觉反馈).gv-changelog-lightbox— 全屏固定遮罩(rgba(0,0,0,0.88)),cursor: zoom-out,附带淡入+轻微缩放的入场动画.gv-changelog-lightbox-img—max-width: 90vw / max-height: 88vh,圆角,深色阴影;pointer-events: none防止图片拦截点击关闭事件