Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 缺陷报告
description: 报告标注、笔记保存、恢复或界面中的问题
title: '[Bug] '
body:
- type: markdown
attributes:
value: |
安全漏洞请使用[私密报告](https://github.com/aredddd/GlassNote/security/advisories/new),不要公开利用细节。
备份包含 URL、摘录、前后文和笔记。请使用公开网页或合成示例,不要上传真实完整备份、令牌、账号信息或私人截图。
- type: checkboxes
id: preparation
attributes:
label: 提交前确认
options:
- label: 我已搜索已有 Issue,未找到能覆盖此问题的报告。
required: true
- label: 以下内容及附件已经脱敏,不含私人笔记、完整真实备份或凭据。
required: true
- type: textarea
id: environment
attributes:
label: 使用环境
description: 可在浏览器扩展管理页查看 GlassNote 版本。
placeholder: |
GlassNote 版本或提交:
浏览器名称与完整版本:
操作系统:
安装方式(源码加载、下载包、商店等):
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: 复现步骤
description: 写明是首次创建、刷新、关闭重开、页面切换、升级还是导入后出现。
placeholder: |
1. 打开……
2. 选择……并保存……
3. 刷新或重新打开后……
validations:
required: true
- type: textarea
id: expected_actual
attributes:
label: 预期与实际结果
description: 如果标注消失或漂移,请说明笔记库里是否仍能看到摘录和想法,以及是否提示未定位或保存失败。
placeholder: |
预期:
实际:
出现频率:
validations:
required: true
- type: textarea
id: sample
attributes:
label: 最小示例与截图
description: 可提供公开页面地址、最小 HTML、合成备份或脱敏截图。私人网页不必提供原地址;请用示例文字描述结构。
- type: textarea
id: logs
attributes:
label: 错误信息或其他线索
description: 如有错误提示,请粘贴相关片段。不要附上整个浏览器配置或未经检查的日志。
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 私密安全报告
url: https://github.com/aredddd/GlassNote/security/advisories/new
about: 漏洞利用细节和敏感复现材料请勿发布到公开 Issue。
- name: 使用说明与支持范围
url: https://github.com/aredddd/GlassNote/blob/main/README.md
about: 查看安装、升级、备份与网页兼容范围。
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 功能建议
description: 说明阅读或整理笔记时遇到的问题与希望改进的行为
title: '[建议] '
body:
- type: markdown
attributes:
value: |
请从具体使用场景出发。涉及私人文章或笔记时,请使用虚构示例;安全问题请走[私密报告](https://github.com/aredddd/GlassNote/security/advisories/new)。
- type: checkboxes
id: preparation
attributes:
label: 提交前确认
options:
- label: 我已查看现有功能说明并搜索已有 Issue。
required: true
- type: textarea
id: problem
attributes:
label: 你遇到了什么问题?
description: 描述阅读、标注、恢复或整理笔记时的具体场景,以及现有操作为什么不方便。
validations:
required: true
- type: textarea
id: proposal
attributes:
label: 期望怎样改进?
description: 用一次实际操作说明希望看到的行为或结果。
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: 现有做法与替代方案
description: 如果已有临时解决办法,也请说明它的限制。
- type: textarea
id: scope
attributes:
label: 其他说明
description: 可附脱敏示意图。若涉及同步、网络服务或新增权限,请说明这些能力为什么是该场景所必需的。
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## 问题与改动

<!-- 写清具体触发条件、原来的问题及修改后的行为。有关联 Issue 时附链接。 -->

## 验证

<!-- 列出实际执行的命令和结果。网页交互、存储迁移或 UI 改动请补对应验证;未执行或未覆盖的检查写明原因。截图使用公开或合成内容。 -->

## 影响与限制

<!-- 说明对旧数据、原文定位、权限、隐私或依赖的影响;没有相关变化可写“不涉及”。引入第三方材料时注明来源与许可证。 -->

## 提交前检查

- [ ] 我已阅读 [贡献指南](https://github.com/aredddd/GlassNote/blob/main/CONTRIBUTING.md),确认有权提交这些内容。
- [ ] 已检查附件和修改内容,不含私人笔记、真实完整备份、浏览器配置、令牌或无关产物。
- [ ] 已完成与改动有关的验证,并写明尚未验证的情况。
- [ ] 如涉及数据格式、导入迁移、权限或数据处理,已补相应回归并更新相关说明;不涉及则勾选。
62 changes: 62 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI

on:
push:
branches: ['**']
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
name: 格式、单元测试与真实扩展回归
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: 检出代码
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: 设置 Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '24'
cache: npm

- name: 按锁文件安装开发依赖
run: npm ci

- name: 检查语法、扩展入口和格式
run: |
npm run check
npm run format:check

- name: 安装测试浏览器
run: npx playwright install --with-deps chromium

- name: 运行单元测试
run: npm test

- name: 运行真实扩展回归
run: npm run test:e2e

# 测试使用隔离浏览器与本地网页,不自动访问用户指定的真实网站。
- name: 构建并验证发布包
run: |
npm run package
npm run package:verify

- name: 保留失败时的测试截图
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: failed-test-screenshots
path: test-results/
if-no-files-found: ignore
retention-days: 7
104 changes: 104 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: 发布扩展

on:
push:
tags:
- 'v*'

permissions:
contents: read

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
name: 校验标签、测试并构建
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: 检出标签源码
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: 设置 Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '24'
cache: npm

- name: 校验标签和项目版本
run: node scripts/verify-package.cjs --version-only --tag "$GITHUB_REF_NAME"

- name: 按锁文件安装开发依赖
run: npm ci

- name: 检查语法、扩展入口和格式
run: |
npm run check
npm run format:check

- name: 安装测试浏览器
run: npx playwright install --with-deps chromium

- name: 运行单元测试和真实扩展回归
run: |
npm test
npm run test:e2e

- name: 构建并验证 ZIP 与 SHA256SUMS
run: |
npm run package -- --tag "$GITHUB_REF_NAME"
npm run package:verify -- --tag "$GITHUB_REF_NAME"

- name: 保存经过校验的发布资产
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: glassnote-release
path: |
dist/GlassNote-${{ github.ref_name }}.zip
dist/SHA256SUMS
if-no-files-found: error
compression-level: 0
retention-days: 7

publish:
name: 发布 GitHub Release
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: write
steps:
- name: 检出同一标签的校验脚本和发布说明
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: 设置 Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '24'

- name: 下载本次构建的发布资产
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: glassnote-release
path: dist

- name: 发布前复验版本、文件清单和 SHA-256
run: node scripts/verify-package.cjs --tag "$GITHUB_REF_NAME"

- name: 创建 GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
archive="dist/GlassNote-${GITHUB_REF_NAME}.zip"
title="GlassNote ${GITHUB_REF_NAME#v}"
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
echo '::error::该标签已经存在 Release,拒绝覆盖已发布资产;请使用新版本。'
exit 1
fi
gh release create "$GITHUB_REF_NAME" "$archive" dist/SHA256SUMS --verify-tag --target "$GITHUB_SHA" --title "$title" --notes-file CHANGELOG.md --draft=false --prerelease=false
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 更新日志

## [3.0.0] - 2026-09-29

### 新增

- 集中管理所有网页的笔记库,支持搜索、编辑及 JSON 备份导入导出。
- 通过原文、上下文和位置共同定位标注;无法可靠恢复时保留笔记并显示待定位。
- MIT 许可、贡献与安全指南、反馈模板、自动回归及版本打包流程。

### 改进

- 重做扩展弹窗、浮动工具栏和页面笔记面板,采用浅色玻璃质感界面。
- 使用 CSS Custom Highlight API 绘制标注,减少对原网页 DOM 的影响。
- 后台串行写入,兼容旧版数据迁移,保留旧版原始存储。

### 修复

- 修复重开网页后笔记无法显示、重复文本误定位与页面变化后位置漂移的问题。
- 同一处文字再次点击高亮、下划线或加粗即可取消格式;重复点击同色取消高亮,换色更新原记录。
- 取消格式时保留附带笔记;编辑笔记不会重新创建已删除标注。

### 已知限制

- 面向桌面 Edge / Chrome 的普通网页主文档;不支持浏览器内部页、内置 PDF、Canvas、iframe 内文与封闭 Shadow DOM。
- 大幅改写或删除原文后无法保证自动定位;笔记仍保留在笔记库。
- 本地保存,无跨设备同步;Edge 商店发布进度与 GitHub 版本发布分别管理。

更早版本尚未整理为独立发行记录,历史改动见 [Git 提交记录](https://github.com/aredddd/GlassNote/commits/main/)。

[3.0.0]: https://github.com/aredddd/GlassNote/releases/tag/v3.0.0
Loading