Conversation
Manual Translate / Prioritize / Re-translate on a paper card now POSTs priority=true so the job is inserted (or bumped) at the head of its fast/slow lane, after currently running work. Translate-all stays FIFO. Co-authored-by: Daniel <znsoft@163.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Card Translate (「翻译」) now priority-enqueues a paper at the head of its fast/slow lane, so a click runs soon instead of waiting behind the whole backlog.
Stacked on
cursor/papers-load-perf-1d37(the current papers UI + dual-lane translate queue).maindoes not yet contain the translation system.Semantics
POST /papers/translateaccepts"priority": trueon a singleid:fast≤50 pages,slow51–100). It is the next job that lane willtryPopafter currently running work.runningis still rejected (正在翻译中). Priority only reorders the pending lane queue.priorityremains a no-op skip.priorityand keep FIFO tail append, so the backlog is not reversed.page_count > 100still reject withtoo_many_pages; no button is shown.authorizeSettings/can_manage). Anonymous visitors never see the control.UI
Shared
renderPaperCard(catalog + Hugging Face Daily):priority: true)force+priority)Test plan
TestPriorityEnqueueInsertsAheadOfNormalQueue— new priority id sits in front of tail-queued itemsTestPriorityEnqueueBumpsAlreadyQueued— already-queued id moves to head; no duplicate; non-priority second click is a no-opTestPriorityEnqueueDoesNotPreemptRunning— running id rejected; nexttryPopis the prioritized paperTestPriorityEnqueueStaysInLane— slow-lane priority does not jump the fast queueTestPriorityEnqueueIgnoredForTranslateAll—{all:true, priority:true}stays FIFOTestPapersTranslatePostPriorityNearFront— HTTPpriority:truerequires auth and lands at the lane headpriority: truepayload assertionsgo test ./internal/api/(full package, pass)/papers: Translate → Translate pending → Prioritize on Gamma; queue became2401.00003, 2401.00001, 2401.00002(Gamma at the lane head). Status: 「已移到队列最近位置。」