Conversation
* set fork-related context data * show submit button based on permissions * add ForkAndEdit field to EditRepoFileForm * modify EditFilePost to handle fork creation and commit to fork * reuse existing fork if user already has one
* query repos by owner and subject * check for existing user repo for subject * disable edit/fork buttons when user already has a repo for the subject * show message in edit view explaining why editing is disabled
* fix wrong error condition (returned on any error, not just 'not found') * fix double increment bug (i++ in loop body + loop increment) * optimise from O(n) queries to single query with hash set lookup O(1) * add proper error logging
* run subject ownership check and fork detection concurrently
* add error for subject ownership violations * validate subject ownership before forking
* fix POST handler to validate subject ownership
* create IDX_repository_owner_subject and IDX_repository_owner_fork * optimizes GetRepositoryByOwnerIDAndSubjectID() and GetForkedRepo() queries
* replace 'Cannot Edit' button with 'Edit Your Article' action link * add translation keys for fork-on-edit error messages * link users to their existing article when subject ownership blocks editing
* simplify fork_and_edit hidden field to only use .NeedsFork * extract repeated nil-guard pattern into $subjectName template variable
* add Playwright tests for modal appearance, cancel actions, and tooltip * test modal shows correct header, content, and button text * verify cancel button and Escape key close modal without action * verify fork button has tooltip with confirmation message
* add repository owner tests for Submit Changes button behavior * add non-owner tests for Fork button and disabled submit button * add unauthenticated user test for sign-in button
* accessibility tests verify Enter opens modal, Tab navigates buttons, and buttons have proper accessible text content * unique name tests verify suffix generation when base name is taken
* use RepoOperationsLink instead of RepoLink in form action url * bypass fork_and_edit in CanWriteToBranch middleware to allow non-owners to reach the EditFilePost handler * skip NeedFork workflow when ForkAndEdit is true to prevent conflicting fork creation attempts
* CheckForkOnEditPermissions for owner/non-owner/unauthenticated * CanWriteToBranch middleware bypass with fork_and_edit=true * existing fork detection using fixture data (repo11/repo10) * subject ownership blocking prevents duplicate forks * form action URL uses RepoOperationsLink not RepoLink
* slug generation migration covering basic slugs, mixed-case deduplication, special characters, unique constraint verification, and empty table handling * index creation, idempotency, and index type verification
…order * fork API behavior when user already owns a repository for the same subject * fork blocked by subject ownership (403), fork succeeds for user without subject repo (202), fork blocked even with custom name (403) * fix error handling order in CreateFork
* update GetForkedRepo signature to return (*Repository, error) * update all callers to handle the new error return value * fixes silent error swallowing
* fix modal promise resolution pattern * add PathEscapeSegments to article template URL * update test comment to list all removed special characters
…th check - Make navbar-pill-active conditional on PageIsPullList so it's only highlighted on PR-related pages (fixes always-active pill bug) - Add $.SignedUserID check to review submit button condition to prevent showing it to unauthenticated users - Fix split/unified view toggle (replace broken JS onclick with server-side rendered <a> tag) - Add mobile default to unified view - Add CSS overrides for conversation-holder comments and PR diff styling
Remove .IsShowingAllCommits from the outer condition in box.tmpl since review_submit.tmpl already handles the disabled state internally when not showing all commits. This matches the master behavior where the review button is always rendered for signed-in users on PR file pages. Fixes TestPullDiff_SingleCommitPRDiff and TestPullDiff_CommitRangePRDiff which expect .js-btn-review to exist with a disabled class.
|
/crush_fast AI review started. |
Advanced AI Review
Click to expand reviewBased on my thorough review of these changes, here are the issues I've identified: 🔴 Issue 1: Missing
|
| Priority | Count |
|---|---|
| 🔴 High | 3 |
| 🟡 Medium | 4 |
| ⚪ Low | 2 |
The most critical issues are:
- Missing template attribute - The fork modal won't display correctly
- Unused title field - Misleading UX where user input is silently discarded
- Commented CSS - Likely breaks non-PR issue pages
Review generated using glm-5 via Z.AI. Comment /review to re-run.
The JavaScript in article-editor.ts reads data-fork-confirm-body2 to display a second paragraph in the fork confirmation modal, but the template was missing this attribute. The locale key already exists. Fixes AI Review Issue #1.
The backend SubmitReviewForm struct has no Title field, so the title input was silently discarded. This removes it to avoid misleading users. Fixes AI Review Issue #2.
Move inline onclick handlers to addEventListener calls for CSP compatibility. Affects the diff info banner dismiss button in box.tmpl and the PR back link in view_title.tmpl. Fixes AI Review Issue #4.
The review modal could only be closed by clicking the X button or the overlay. Add a keydown listener so pressing Escape also closes it. Fixes AI Review Issue #5.
Replace 'Post immediately', 'Save draft', and 'Click a paragraph to add a comment.' with ctx.Locale.Tr calls. Add corresponding keys to the custom locale file. Fixes AI Review Issue #6.
Add sessionStorage guard so the automatic redirect from split to unified view on mobile only fires once per session. Previously, if a user switched back to split view, they'd be immediately redirected again. Fixes AI Review Issue #7.
This PR updates the pull request review UI, improves internationalization, and standardizes CSS practices across the fork design pages.
Changes
🎨 UI & Styling
Review modal: Replaced the tippy.js popup with a proper overlay modal for submitting pull request reviews
Renamed new_review.tmpl → review_submit.tmpl for clarity
Split diff headers: Added styled column headers ("Current article" / "Change requested") to the split diff view
CSS variables: Replaced ~60 hardcoded hex/rgb colors across 6 CSS files with semantic CSS variables (e.g., --color-text-primary, --color-border, --color-surface-muted)
Font weights: Replaced hardcoded font-weight values (500, 600, 700) with CSS variable equivalents (--font-weight-medium, --font-weight-semibold, --font-weight-bold)
🌐 Internationalization
Added 12 new locale keys for the review modal, split diff headers, and back navigation
Replaced all hardcoded English strings in review_submit.tmpl,
section_split.tmpl
, and
view_title.tmpl
🧹 Code Quality
Removed inline <script> from the review template — moved logic to
repo-issue.ts
using data attributes and class hooks
Removed all stylelint-disable comments (13 total) by converting values to CSS variables
Removed unused createTippy import from
repo-issue.ts
Fixed getElementById → querySelector per ESLint rules
Fixed javascript:history.back() → proper onclick handler in
view_title.tmpl
Added
switchToUserPreference()
no-op to
ToastCommentEditor
for API compatibility