Conversation
Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com>
(cherry picked from commit c7137ff)
Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com> (cherry picked from commit 07d7590) Update feature.yml Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com> (cherry picked from commit 1a99430) Update docs.yml Signed-off-by: Zhu Chenrui <boomzero_zcr@outlook.com> (cherry picked from commit 6017bcf)
Signed-off-by: Shan Wenxiao <seanoj_noreply@yeah.net>
…ns[bot] This prevents infinite loops where the bot commits version updates, which triggers the workflow again, causing another commit. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The last-commit-author guard now only exits for non-edited events, so PR title/body changes still update Update.json metadata even when the branch tip is a github-actions[bot] commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exclude all bot actors (not just github-actions[bot]) from triggering the UpdateVersion workflow, preventing loops from AI code review bots. Allow edited events through the script-level guard so PR title/body changes still update Update.json metadata. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update to release 3.2.2
Reviewer's GuideRefactors how contest problem lists are loaded and refreshed in the problem switcher and adds an optional image enlargement utility with modal viewing, zoom, pan, navigation, and download support. Sequence diagram for contest problem switcher refreshsequenceDiagram
actor User
participant ProblemSwitcherUI
participant GetContestProblemList
participant XMOJServer
participant LocalStorage
participant Browser
User->>ProblemSwitcherUI: Load contest page with script
ProblemSwitcherUI->>LocalStorage: getItem(UserScript_Contest_cid_ProblemList)
alt ProblemList not in LocalStorage
ProblemSwitcherUI->>GetContestProblemList: GetContestProblemList(false)
GetContestProblemList->>XMOJServer: fetch(contest.php?cid=cid)
XMOJServer-->>GetContestProblemList: HTML contest page
GetContestProblemList->>GetContestProblemList: Parse DOM and extract problem rows
GetContestProblemList->>LocalStorage: setItem(UserScript_Contest_cid_ProblemList, problemList)
GetContestProblemList-->>ProblemSwitcherUI: return
ProblemSwitcherUI->>LocalStorage: getItem(UserScript_Contest_cid_ProblemList)
end
ProblemSwitcherUI->>Browser: Render problemSwitcher and problem buttons
User->>ProblemSwitcherUI: Click refresh link in problemSwitcher
ProblemSwitcherUI->>GetContestProblemList: GetContestProblemList(true)
GetContestProblemList->>XMOJServer: fetch(contest.php?cid=cid)
XMOJServer-->>GetContestProblemList: HTML contest page
GetContestProblemList->>GetContestProblemList: Parse DOM and rebuild problemList
GetContestProblemList->>LocalStorage: setItem(UserScript_Contest_cid_ProblemList, problemList)
GetContestProblemList->>Browser: location.reload()
Browser->>ProblemSwitcherUI: Reload page and rebuild problemSwitcher from updated list
Class diagram for updated problem loader and new image enlarger utilityclassDiagram
class ProblemSwitcherModule {
+main()
+UtilityEnabled(utilityName)
}
class GetContestProblemListUtility {
+GetContestProblemList(RefreshList)
}
class ImageEnlargerUtility {
+initImageEnlarger()
+OpenImageModal(imgElement)
+CloseImageModal()
+NavigateTo(index)
+UpdateImageSize()
+UpdateNavButtons()
+ApplyEnlargerToImage(img)
+ApplyEnlargerToImages()
}
class ImageModalState {
-CurrentZoom : number
-ZoomStep : number
-MinZoom : number
-MaxZoom : number
-ImageList : string[]
-CurrentImageIndex : number
-PanX : number
-PanY : number
-IsDragging : boolean
-IsTouchPanning : boolean
-DragStartX : number
-DragStartY : number
-DragStartPanX : number
-DragStartPanY : number
-TouchStartX : number
-TouchStartY : number
-TouchPanStartPanX : number
-TouchPanStartPanY : number
}
ProblemSwitcherModule --> GetContestProblemListUtility : uses
ProblemSwitcherModule --> ImageEnlargerUtility : uses when ImageEnlarger enabled
ImageEnlargerUtility --> ImageModalState : manages
State diagram for the new image enlargement modalstateDiagram-v2
[*] --> Hidden
Hidden: Modal not visible
Visible: Modal visible at base zoom
Zoomed: Image zoomed or panned
Hidden --> Visible: OpenImageModal
Visible --> Hidden: CloseImageModal
Visible --> Zoomed: ZoomIn or ZoomOut or StartPan
Zoomed --> Zoomed: ContinuePan or ZoomIn or ZoomOut
Zoomed --> Visible: ResetZoom
Visible --> Visible: NavigateToNext or NavigateToPrev
Zoomed --> Zoomed: NavigateToNext or NavigateToPrev
Visible --> Hidden: EscapeKey or ClickBackdrop
Zoomed --> Hidden: EscapeKey or ClickBackdrop
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Signed-off-by: zsTree <wa2025666@gmail.com>
Signed-off-by: zsTree <wa2025666@gmail.com>
PythonSmall-Q
left a comment
There was a problem hiding this comment.
Please check if the suggestions given by sourcery-ai is true. If so, fix them.
|
Maybe I should fix this? I can just tell Claude to do it( |
Signed-off-by: zsTree <wa2025666@gmail.com>
|
@boomzero @PythonSmall-Q Fixed |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
I think I would merge this one, because of the effort you spent |
|
But first, @codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Oh, okay, then good |
Takes all logic fixes from PR #933 (GetContestProblemList helper, null-safe init, XSS fix, ImageEnlarger) while keeping the ↻ button UI from this branch instead of #933's inline 'refreshList' text link. - Removed .refreshList CSS and the inline onclick "刷新" element - Resolved Update.json version conflict: both PRs credited under 3.3.2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
|
This is a combination of these two PRs that improves the UI |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
tks |
What does this PR aim to accomplish?
Fix *EX problems not display.
How does this PR accomplish the above?
Update list when click the refresh button. (The refresh button is located at the top of the problem switcher)
By submitting this pull request, I confirm the following:
git rebase)Summary by Sourcery
Fix contest problem switcher updates and add an optional image enlargement utility.
New Features:
Bug Fixes:
Enhancements:
Summary by cubic
Fixes the contest Problem Switcher so it refreshes reliably and no longer shows empty entries. Adds a manual “刷新” action, exposes
GetContestProblemList(), and bumps the script to 3.3.2 with updatedUpdate.jsonrelease notes.Bug Fixes
GetContestProblemList()to fetch/cache contest problems and initialize when missing; clicking “刷新” reloads the list.New Features
Written for commit c87d08f. Summary will update on new commits.