|
@@ -118,6 +118,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
readonly wordPreviewPage = signal(1);
|
|
readonly wordPreviewPage = signal(1);
|
|
|
readonly wordPreviewTotal = signal(0);
|
|
readonly wordPreviewTotal = signal(0);
|
|
|
readonly wordPreviewLoading = signal(false);
|
|
readonly wordPreviewLoading = signal(false);
|
|
|
|
|
+ private historyPreviewWords: Word[] = [];
|
|
|
readonly selected = signal<Set<string>>(new Set());
|
|
readonly selected = signal<Set<string>>(new Set());
|
|
|
readonly selectionRevealed = signal<Set<string>>(new Set());
|
|
readonly selectionRevealed = signal<Set<string>>(new Set());
|
|
|
readonly selectionAssessment = signal<Record<string, 'known' | 'unknown'>>({});
|
|
readonly selectionAssessment = signal<Record<string, 'known' | 'unknown'>>({});
|
|
@@ -487,6 +488,12 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
if (target === this.wordPreviewPage() || this.wordPreviewLoading()) return;
|
|
if (target === this.wordPreviewPage() || this.wordPreviewLoading()) return;
|
|
|
const previous = this.wordPreviewPage();
|
|
const previous = this.wordPreviewPage();
|
|
|
this.wordPreviewPage.set(target);
|
|
this.wordPreviewPage.set(target);
|
|
|
|
|
+ if (this.isHistoryWordView) {
|
|
|
|
|
+ const start = (target - 1) * this.wordPreviewPageSize;
|
|
|
|
|
+ this.words.set(this.historyPreviewWords.slice(start, start + this.wordPreviewPageSize));
|
|
|
|
|
+ setTimeout(() => document.getElementById('readonly-word-title')?.scrollIntoView({ behavior: 'smooth', block: 'start' }));
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
this.wordPreviewLoading.set(true);
|
|
this.wordPreviewLoading.set(true);
|
|
|
this.loadReadOnlyWords(true, previous);
|
|
this.loadReadOnlyWords(true, previous);
|
|
|
}
|
|
}
|
|
@@ -1157,7 +1164,8 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
this.api.post<unknown>('e_record_detail', { id: this.query('id') }).pipe(finalize(() => this.loading.set(false))).subscribe({
|
|
this.api.post<unknown>('e_record_detail', { id: this.query('id') }).pipe(finalize(() => this.loading.set(false))).subscribe({
|
|
|
next: ({ result, addon }) => {
|
|
next: ({ result, addon }) => {
|
|
|
const words = this.findList(result).map((item) => this.toWord(item)).filter((word) => word.word);
|
|
const words = this.findList(result).map((item) => this.toWord(item)).filter((word) => word.word);
|
|
|
- this.words.set(words);
|
|
|
|
|
|
|
+ this.historyPreviewWords = words;
|
|
|
|
|
+ this.words.set(words.slice(0, this.wordPreviewPageSize));
|
|
|
this.wordPreviewTotal.set(words.length);
|
|
this.wordPreviewTotal.set(words.length);
|
|
|
const sourceAddon = this.findList(addon)[0];
|
|
const sourceAddon = this.findList(addon)[0];
|
|
|
if (sourceAddon) this.orderInfo.set(sourceAddon);
|
|
if (sourceAddon) this.orderInfo.set(sourceAddon);
|
|
@@ -1850,6 +1858,7 @@ export class LearningPageComponent implements OnInit, OnDestroy {
|
|
|
this.nodes.set([]);
|
|
this.nodes.set([]);
|
|
|
this.selectedNodes.set(new Set());
|
|
this.selectedNodes.set(new Set());
|
|
|
this.words.set([]);
|
|
this.words.set([]);
|
|
|
|
|
+ this.historyPreviewWords = [];
|
|
|
this.wordPreviewPage.set(1);
|
|
this.wordPreviewPage.set(1);
|
|
|
this.wordPreviewTotal.set(0);
|
|
this.wordPreviewTotal.set(0);
|
|
|
this.wordPreviewLoading.set(false);
|
|
this.wordPreviewLoading.set(false);
|