Skip to content

feat: add vocabulary list table view - #99

Merged
githubSINGLE merged 2 commits into
sallowayma-git:opensourcefrom
lake0000:feature/vocab-list-view
Aug 6, 2026
Merged

feat: add vocabulary list table view#99
githubSINGLE merged 2 commits into
sallowayma-git:opensourcefrom
lake0000:feature/vocab-list-view

Conversation

@lake0000

@lake0000 lake0000 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

@lake0000
lake0000 marked this pull request as draft August 3, 2026 09:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c599f33a92

ℹ️ 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".

Comment thread js/components/vocabSessionView.js Outdated
Comment on lines +1247 to +1248
if (correctCount >= masteredTarget) {
return { label: '已掌握', tone: 'mastered' };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Show due mastered words as due

When a word has reached masteryCount and its nextReview time later passes, VocabStore.getDueWords() still queues it for review, but this early return labels it only as “已掌握.” Because dueCount is also derived from this tone, the modal understates pending reviews and disagrees with the review queue. Check whether nextReview is due before returning the mastered status, or calculate the due statistic independently.

Useful? React with 👍 / 👎.

Comment thread js/components/vocabSessionView.js Outdated
showFeedbackMessage('词表面板未加载', 'warning');
return;
}
state.ui.lastFocus = document.activeElement;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore focus to the visible menu trigger

When a keyboard user selects “查看词表,” the menu handler calls closeMenu() before this assignment, so document.activeElement is the menu item whose parent has just been hidden (or the browser's focus-fixup target), not the visible menu toggle. Closing the modal therefore tries to focus a hidden element and leaves keyboard users without a useful focus position; retain the menu toggle as the restoration target instead.

Useful? React with 👍 / 👎.

Comment thread js/components/vocabSessionView.js Outdated
name: getActiveListLabel(),
query: state.ui.listBrowserQuery || '',
learnedOnly: state.ui.listBrowserLearnedOnly,
words: getVisibleListWords()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent filtered exports from replacing the whole list

When a search or “只看已学” filter is active, this exports only the visible subset, but the payload also contains a version string, so VocabDataIO.parseJson() classifies it as a progress backup. Importing that exported file through the existing menu then reaches performImport()'s setWords(entries) path and persistently replaces the active list with the subset, deleting every filtered-out word. Either export the complete active list or use a word-list format that the importer merges rather than replaces.

Useful? React with 👍 / 👎.

Comment thread css/main.css Outdated
}

.vocab-list-modal__body {
min-height: 220px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow the list body to shrink on short screens

On short viewports at or below 768px wide, such as a phone in landscape, the mobile rules stack the three toolbar controls while forcing the dialog to height: 100%; the header, stacked toolbar, stats, and this 220px minimum exceed the available height. Since the dialog has overflow: hidden, part of the table viewport and its scrollbar is clipped. Let this flex child shrink with min-height: 0/flex: 1, or make the dialog itself scroll.

Useful? React with 👍 / 👎.

@sallowayma-git
sallowayma-git force-pushed the feature/vocab-list-view branch from c599f33 to 2cf60df Compare August 6, 2026 16:36
@githubSINGLE
githubSINGLE marked this pull request as ready for review August 6, 2026 16:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cf60df7d7

ℹ️ 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".

Comment thread js/utils/vocabDataIO.js
Comment on lines +230 to +233
const hasListId = typeof payload.listId === 'string' && payload.listId.trim();
const hasV2ProgressEnvelope = typeof payload.version === 'string'
&& isPlainObject(payload.config)
&& hasListId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Accept pre-v2 progress backups

Backups exported before the v2 data migration contain version, config, words, and reviewQueue, but no top-level listId. Requiring listId here makes every such backup fall through as a word list, so normalizeEntry() strips its scheduling fields and performImport() merges it instead of restoring the saved progress and configuration. Preserve the legacy reviewQueue/progress-field detection and derive the list identity from config.activeListId when importing that format.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v1 逻辑直接废弃,不需要兼容

@githubSINGLE
githubSINGLE merged commit 28db053 into sallowayma-git:opensource Aug 6, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants