From d34e6fd8da53a65e08aea4842a1590a72c4eaa06 Mon Sep 17 00:00:00 2001 From: ishiko Date: Mon, 14 Apr 2025 00:53:30 +0800 Subject: [PATCH 1/4] Fix/avoid using a hard-code timezone (#36) * Release: v0.1.4 * Fix/avoid using a hard-code timezone --------- Co-authored-by: Haco <75477391+xiaohajiayou@users.noreply.github.com> Co-authored-by: xiaohajiayou <923390377@qq.com> --- README.md | 29 +++++++++++++++++------------ changelog.md | 30 ++++++++++++++++++++++++++++++ manifest.base.json | 2 +- package-lock.json | 2 +- package.json | 2 +- popup.html | 4 ++-- src/popup/delegate/fsrsDelegate.js | 5 ++++- 7 files changed, 56 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 2fbecfd..e6b1650 100644 --- a/README.md +++ b/README.md @@ -83,24 +83,29 @@ | url添加自定义卡片 | ✅ 已完成 | 用于记录面试手撕题、其他刷题网站用户暂时替代方案 | | 提供笔记功能 | ✅ 已完成 | 题目列表中新增笔记按钮,支持导出所有笔记为Markdown | | 收集Anki fsrs 训练数据 | ✅ 已完成 | 待用于测试fsrs官方端口训练 | -| 接入Anki fsrs官方训练端口 | ❌ 待完成 | 待评估可行性(用户可拟合出最适合自己的记忆曲线) | +| 接入Anki fsrs官方训练端口 | ✅ 已完成 | 目前仅支持本地复习记录训练(云同步用户可能存在影响) | +| 扩展webdev云同步服务 | ❌ 待完成 | 待接入坚果云 | +| 支持语言切换 | ❌ 待完成 | 待完成 | | 不同网站题目数据源切换 | ❌ 待完成 | 待完成(目前仅支持力扣国际站和中国站,待兼容洛谷等) | | 兼容火狐 | ❌ 待完成 | 待完成 | | 兼容`ctrl + enter` | ❌ 待完成 | 目前优先级较低 | # 📝 Next Steps -| Task/Feature | Status | Notes | -|-----------------------|------------|------------------------------------| -| Multi-device data cloud sync | ✅ Completed | Edge, Chrome | -| Monitor reminder | ✅ Completed | bilibili, youtube | -| URL add LeetCode problems | ✅ Completed | For brushing questions with IDE, dedicated to working position entertainment | -| URL add custom cards | ✅ Completed | For recording interview hand-torn problems, alternative solution for other question brushing websites | -| Provide note-taking feature | ✅ Completed | Add note button in question list, support exporting all notes as Markdown | -| Collect Anki fsrs training data | ✅ Completed | Pending for testing fsrs official port training | -| Integrate Anki fsrs official training port | ❌ Pending | To be assessed for feasibility (users can fit their own optimal memory curve) | -| Switch between different website question data sources | ❌ Pending | To be completed (currently only supports LeetCode international and Chinese stations, to be compatible with Luogu, etc.) | -| Compatibility with Firefox | ❌ Pending | To be completed | +| Task/Feature | Status | Remarks | +|----------------------------|-----------|----------------------------------------------| +| Multi-device cloud sync | ✳️ Completed | Edge, Chrome | +| Monitoring reminders | ✳️ Completed | bilibili, youtube | +| Add LeetCode URL | ✳️ Completed | For IDE coding practice, perfect for working | +| Add custom card URL | ✳️ Completed | For recording interview problems, alternative for other coding websites | +| Provide note-taking feature | ✳️ Completed | Add note button in problem list, support exporting all notes to Markdown | +| Collect Anki FSRS training data | ✳️ Completed | To be used for testing FSRS official training endpoint | +| Integrate Anki FSRS official training endpoint | ✳️ Completed | Currently supports training with local review records (may affect cloud sync users) | +| Expand webdev cloud sync service | ❌ Pending | To be integrated with Nutstore | +| Support language switching | ❌ Pending | Pending completion | +| Switch data sources for different websites | ❌ Pending | Pending completion (currently only supports LeetCode international and Chinese sites, to be compatible with Luogu, etc.) | +| Compatibility with Firefox | ❌ Pending | Pending completion | +| Compatibility with `ctrl + enter` | ❌ Pending | Lower priority for now | diff --git a/changelog.md b/changelog.md index a0549f9..0e15123 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,35 @@ # Changelog + + +## [0.1.4] - 2025-04-08 +---------------------- + +### Added + +* 新增本地 FSRS 算法参数优化,用户可以拟合最适合自己的记忆曲线。(#15) + + +### Fixed + +* 修复了在页面缩放时,rate 按钮消失的问题。(#32) + + + + + + + + + + + + + + + + + ## [0.1.3] - 2025-04-02 ### Added diff --git a/manifest.base.json b/manifest.base.json index 4258625..38f881b 100644 --- a/manifest.base.json +++ b/manifest.base.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "Leetcode Mastery Scheduler", - "version": "0.1.3", + "version": "0.1.4", "author": "Hacode", "description": "Leetcode-Mastery-Scheduler tracks your LeetCode progress and prompt you to review based FSRS", "homepage_url": "https://github.com/xiaohajiayou/Leetcode-Mastery-Scheduler", diff --git a/package-lock.json b/package-lock.json index eae727d..3913eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "Leetcode-Mastery-Scheduler", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 66fc920..da24320 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Leetcode-Mastery-Scheduler", - "version": "0.1.3", + "version": "0.1.4", "description": "

\r \r
\r Practice Makes Code Accepted\r
\r

", "main": "src/popup.js", "directories": { diff --git a/popup.html b/popup.html index e3577b1..f042dc0 100644 --- a/popup.html +++ b/popup.html @@ -357,11 +357,11 @@

Add Review Card

NEW! - 新增笔记撰写和导出功能。 / Add note writing and export features + 支持通过复习记录优化fsrs算法参数。 / Support Optimize FSRS parameters.
- View full changelog now(V0.1.3) + View full changelog now(V0.1.4)
diff --git a/src/popup/delegate/fsrsDelegate.js b/src/popup/delegate/fsrsDelegate.js index e120b3b..b2d26a2 100644 --- a/src/popup/delegate/fsrsDelegate.js +++ b/src/popup/delegate/fsrsDelegate.js @@ -3,11 +3,14 @@ export const optimizeFSRSParams = async (csvContent, onProgress) => { try { const formData = new FormData(); const csvBlob = new Blob([csvContent], { type: 'text/csv' }); + // ref: https://github.com/ishiko732/fsrs-online-training/blob/73b3281e4c972bf965083dcfe61f087383b4a083/components/lib/tz.ts#L3-L4 + // Chrome > 24, Edge > 12, Firefox > 29 + const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone formData.append('file', csvBlob, 'revlog.csv'); formData.append('sse', '1'); formData.append('hour_offset', '4'); formData.append('enable_short_term', '0'); - formData.append('timezone', 'Asia/Shanghai'); + formData.append('timezone', timeZone); const response = await fetch('https://ishiko732-fsrs-online-training.hf.space/api/train', { method: 'POST', From 6f8973a88b8bb1d56efdfc5959e18d7aca94e4e0 Mon Sep 17 00:00:00 2001 From: xiaohajiayou <923390377@qq.com> Date: Mon, 14 Apr 2025 01:25:12 +0800 Subject: [PATCH 2/4] Refactor: modify github star button style --- README.md | 4 ++-- popup.html | 55 ++++++++++++++++++++++++--------------------- src/popup/popup.css | 46 +++++++++++++++++++++++++++++++++---- 3 files changed, 74 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index e6b1650..f9a2046 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ | 提供笔记功能 | ✅ 已完成 | 题目列表中新增笔记按钮,支持导出所有笔记为Markdown | | 收集Anki fsrs 训练数据 | ✅ 已完成 | 待用于测试fsrs官方端口训练 | | 接入Anki fsrs官方训练端口 | ✅ 已完成 | 目前仅支持本地复习记录训练(云同步用户可能存在影响) | -| 扩展webdev云同步服务 | ❌ 待完成 | 待接入坚果云 | +| 扩展webdav云同步服务 | ❌ 待完成 | 待接入坚果云 | | 支持语言切换 | ❌ 待完成 | 待完成 | | 不同网站题目数据源切换 | ❌ 待完成 | 待完成(目前仅支持力扣国际站和中国站,待兼容洛谷等) | | 兼容火狐 | ❌ 待完成 | 待完成 | @@ -101,7 +101,7 @@ | Provide note-taking feature | ✳️ Completed | Add note button in problem list, support exporting all notes to Markdown | | Collect Anki FSRS training data | ✳️ Completed | To be used for testing FSRS official training endpoint | | Integrate Anki FSRS official training endpoint | ✳️ Completed | Currently supports training with local review records (may affect cloud sync users) | -| Expand webdev cloud sync service | ❌ Pending | To be integrated with Nutstore | +| Expand webdav cloud sync service | ❌ Pending | To be integrated with Nutstore | | Support language switching | ❌ Pending | Pending completion | | Switch data sources for different websites | ❌ Pending | Pending completion (currently only supports LeetCode international and Chinese sites, to be compatible with Luogu, etc.) | | Compatibility with Firefox | ❌ Pending | Pending completion | diff --git a/popup.html b/popup.html index f042dc0..586772a 100644 --- a/popup.html +++ b/popup.html @@ -164,28 +164,28 @@

Add Review Card

@@ -607,7 +613,6 @@
- - + \ No newline at end of file diff --git a/src/popup/popup.css b/src/popup/popup.css index bfb54d3..3e9011e 100644 --- a/src/popup/popup.css +++ b/src/popup/popup.css @@ -757,15 +757,53 @@ iframe { #github-star-container { display: flex; - align-items: center; /* 垂直居中对齐 */ - height: 30px; /* 固定高度,与按钮一致 */ + align-items: center; + height: 30px; } -/* 确保 GitHub Star 按钮的样式 */ +/* GitHub Star 按钮样式 */ .github-star-btn { + font-size: 0.875rem; + font-family: 'Courier Prime', monospace; + background: #1d2e3d; + border: 1px solid rgba(97, 218, 251, 0.3); + color: #61dafb; + border-radius: 6px; + display: flex; + align-items: center; + gap: 0.6rem; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + padding: 0.35rem 0.8rem; +} + +.github-star-btn:hover { + background: #1a3244; + border-color: #61dafb; + box-shadow: 0 0 10px rgba(97, 218, 251, 0.5); + color: #61dafb; +} + +.github-star-btn .btn-content { display: flex; align-items: center; - height: 100%; /* 使其填满容器高度 */ + gap: 0.6rem; + transition: all 0.3s ease; +} + +.github-star-btn:hover .btn-content { + transform: translateX(2px); +} + +.github-star-btn i { + font-size: 0.875rem; + color: #61dafb; + transition: all 0.3s ease; +} + +.github-star-btn:hover i { + color: #61dafb; } .feedback-btn-review { From f2885db5ba7169757589ebf6a5bfb5c13b4d917e Mon Sep 17 00:00:00 2001 From: ishiko Date: Mon, 14 Apr 2025 00:53:30 +0800 Subject: [PATCH 3/4] Fix/avoid using a hard-code timezone (#36) * Release: v0.1.4 * Fix/avoid using a hard-code timezone --------- Co-authored-by: Haco <75477391+xiaohajiayou@users.noreply.github.com> Co-authored-by: xiaohajiayou <923390377@qq.com> --- src/popup/delegate/fsrsDelegate.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/popup/delegate/fsrsDelegate.js b/src/popup/delegate/fsrsDelegate.js index e120b3b..b2d26a2 100644 --- a/src/popup/delegate/fsrsDelegate.js +++ b/src/popup/delegate/fsrsDelegate.js @@ -3,11 +3,14 @@ export const optimizeFSRSParams = async (csvContent, onProgress) => { try { const formData = new FormData(); const csvBlob = new Blob([csvContent], { type: 'text/csv' }); + // ref: https://github.com/ishiko732/fsrs-online-training/blob/73b3281e4c972bf965083dcfe61f087383b4a083/components/lib/tz.ts#L3-L4 + // Chrome > 24, Edge > 12, Firefox > 29 + const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone formData.append('file', csvBlob, 'revlog.csv'); formData.append('sse', '1'); formData.append('hour_offset', '4'); formData.append('enable_short_term', '0'); - formData.append('timezone', 'Asia/Shanghai'); + formData.append('timezone', timeZone); const response = await fetch('https://ishiko732-fsrs-online-training.hf.space/api/train', { method: 'POST', From a46beed716dda0afc8793605a81a3fd683c78551 Mon Sep 17 00:00:00 2001 From: xiaohajiayou <923390377@qq.com> Date: Mon, 14 Apr 2025 01:25:12 +0800 Subject: [PATCH 4/4] Refactor: modify github star button style --- README.md | 4 ++-- popup.html | 55 ++++++++++++++++++++++++--------------------- src/popup/popup.css | 46 +++++++++++++++++++++++++++++++++---- 3 files changed, 74 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index e6b1650..f9a2046 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ | 提供笔记功能 | ✅ 已完成 | 题目列表中新增笔记按钮,支持导出所有笔记为Markdown | | 收集Anki fsrs 训练数据 | ✅ 已完成 | 待用于测试fsrs官方端口训练 | | 接入Anki fsrs官方训练端口 | ✅ 已完成 | 目前仅支持本地复习记录训练(云同步用户可能存在影响) | -| 扩展webdev云同步服务 | ❌ 待完成 | 待接入坚果云 | +| 扩展webdav云同步服务 | ❌ 待完成 | 待接入坚果云 | | 支持语言切换 | ❌ 待完成 | 待完成 | | 不同网站题目数据源切换 | ❌ 待完成 | 待完成(目前仅支持力扣国际站和中国站,待兼容洛谷等) | | 兼容火狐 | ❌ 待完成 | 待完成 | @@ -101,7 +101,7 @@ | Provide note-taking feature | ✳️ Completed | Add note button in problem list, support exporting all notes to Markdown | | Collect Anki FSRS training data | ✳️ Completed | To be used for testing FSRS official training endpoint | | Integrate Anki FSRS official training endpoint | ✳️ Completed | Currently supports training with local review records (may affect cloud sync users) | -| Expand webdev cloud sync service | ❌ Pending | To be integrated with Nutstore | +| Expand webdav cloud sync service | ❌ Pending | To be integrated with Nutstore | | Support language switching | ❌ Pending | Pending completion | | Switch data sources for different websites | ❌ Pending | Pending completion (currently only supports LeetCode international and Chinese sites, to be compatible with Luogu, etc.) | | Compatibility with Firefox | ❌ Pending | Pending completion | diff --git a/popup.html b/popup.html index f042dc0..586772a 100644 --- a/popup.html +++ b/popup.html @@ -164,28 +164,28 @@

Add Review Card

@@ -607,7 +613,6 @@
- - + \ No newline at end of file diff --git a/src/popup/popup.css b/src/popup/popup.css index bfb54d3..3e9011e 100644 --- a/src/popup/popup.css +++ b/src/popup/popup.css @@ -757,15 +757,53 @@ iframe { #github-star-container { display: flex; - align-items: center; /* 垂直居中对齐 */ - height: 30px; /* 固定高度,与按钮一致 */ + align-items: center; + height: 30px; } -/* 确保 GitHub Star 按钮的样式 */ +/* GitHub Star 按钮样式 */ .github-star-btn { + font-size: 0.875rem; + font-family: 'Courier Prime', monospace; + background: #1d2e3d; + border: 1px solid rgba(97, 218, 251, 0.3); + color: #61dafb; + border-radius: 6px; + display: flex; + align-items: center; + gap: 0.6rem; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + padding: 0.35rem 0.8rem; +} + +.github-star-btn:hover { + background: #1a3244; + border-color: #61dafb; + box-shadow: 0 0 10px rgba(97, 218, 251, 0.5); + color: #61dafb; +} + +.github-star-btn .btn-content { display: flex; align-items: center; - height: 100%; /* 使其填满容器高度 */ + gap: 0.6rem; + transition: all 0.3s ease; +} + +.github-star-btn:hover .btn-content { + transform: translateX(2px); +} + +.github-star-btn i { + font-size: 0.875rem; + color: #61dafb; + transition: all 0.3s ease; +} + +.github-star-btn:hover i { + color: #61dafb; } .feedback-btn-review {