[codex] Stabilize reviewed state and terminal helper recovery#103
Conversation
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ScreenshotsUpdated for |
…he set
The island refactor moved hideReviewedFiles/showAllFiles and hide-mode
toggleReviewed onto a skipRender() + renderIsland() path. But the
status-strip count band ("N files" / "X/N files") and the sidebar "Files"
header (j/k hint + copy-paths trigger) read visibleFileCount and render
OUTSIDE the three refreshed islands. The previous full render kept them
current; the island path left them showing the pre-hide total while the
sidebar and diff list correctly dropped the reviewed file.
Wrap both regions in their own always:true islands (file-count via a
status-strip slot, file-list-header in the sidebar) and refresh them
through a single renderVisibilityIslands() helper wherever the visible set
changes. Also inline the one-line reviewedChangeNeedsSourceDiffListRender()
wrapper and drop the duplicated skipRender() branch in
settleRecentlyReviewedRender() while consolidating the render glue.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The test hard-coded the macOS "Library/Application Support" inbox base, but the rfa script branches on `uname`: Linux (the ubuntu-latest CI runner, where tests/Unit runs in the Core suite) writes to ".local/share". On CI the script created the XDG dir while the test asserted against the never-touched Application Support path, so File::isDirectory()/glob assertions failed. Mirror the script's own branch via PHP_OS_FAMILY so the test targets the inbox base the helper actually writes to on each platform. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…iewed-state
resources/CLAUDE.md calls these tables canonical ("extend it when adding new
actions"), but the island refactor left them stale: toggleReviewed is now an
unconditional skipRender, hideReviewedFiles/showAllFiles/clearRecentlyReviewed
moved to skipRender + island renders, and the reviewed controls now drive a
window-event bridge (rfa-toggle-reviewed / rfa-hide-reviewed /
rfa-show-all-files / rfa-clear-recently-reviewed) rather than the
toggle-reviewed Livewire event, which is now only reached by unit tests.
Update both tables to match and document why the bridge exists (island-scoped
dispatch).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Locks the visible-file-count regression at the browser level: after hiding a reviewed file the status-strip band must read "2/3 files" (this assertion fails against the pre-fix island-only render, which left a stale "3 files"), and clearing the filter restores it. Uses waitFor so it rides Livewire's async island morph without racing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
The file-header checkbox now inlines its reviewed-toggle logic in the @change handler, leaving createDiffFile.onReviewedChange() with no caller. Remove the orphaned method and its mention in the Alpine-scope contract. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Codex CLI <fgilio+codex-cli@publica.la>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f1e649bef
ℹ️ 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".
| $hashesByPath = ReviewedFile::query() | ||
| ->forProjectOrRepo($projectId, $repoPath) | ||
| ->whereIn('file_path', $paths) | ||
| ->pluck('content_hash', 'file_path'); |
There was a problem hiding this comment.
Keep hash validation when rebuilding reviewed state
When a previously reviewed file changes content, SessionStateAction::resolveReviewedFiles() filters that stored row out because its hash no longer matches, but the row remains in reviewed_files. This new reload path plucks every persisted row for the current paths without recomputing or comparing the current hash, so toggling any other file can put the stale path back into $reviewedFiles; ReviewStateService then treats it as reviewed by path alone, allowing Hide reviewed/export state to skip a changed file that was never reviewed at its current content.
Useful? React with 👍 / 👎.
| $this->renderIsland('source-diff-list'); | ||
| $this->renderIsland('file-count'); | ||
| $this->renderIsland('file-list-header'); | ||
| $this->renderIsland('status-strip-copy-paths'); |
There was a problem hiding this comment.
Keep visible-file data in sync with island refreshes
These visibility paths now skip the parent render and refresh only the listed islands, but the Alpine helpers for j/k navigation, isFileVisible(), and the copy-paths menu count read from the page root's data-visible-file-entries, which sits outside these islands and is only regenerated on a parent render. After Hide reviewed/show all or a toggle while hidden, the DOM list updates but that root dataset remains the old list, so keyboard navigation and hidden-file reveal can target files that were just removed.
Useful? React with 👍 / 👎.



Closes: none
Related: none
Summary
Stabilizes the reviewed-file UI path that regressed in the packaged app, refreshes every visible-count surface touched by Hide reviewed, and includes the terminal-helper inbox recovery fixes from the parallel session.
Root Cause
The reviewed controls had three overlapping failure modes:
/js/*.jsassets were loaded with stable URLs in Electron, so a released app could keep stale Alpine factories after an update.The terminal helper also only repaired a stale
inboxleaf file. If the app data directory itself was a file,mkdir -paborted before the helper could write the cold-start inbox path.Solution
@localScript/LocalAssetso local JS gets a filemtime cache-busting query string.reviewPagemethods and a page-global reviewed-action queue that survives Livewire remounts.ReviewedFilerows after toggles so stale Livewire snapshots cannot drop existing marks.reviewed-summaryisland intoreviewed-toggleandreviewed-counter, then refresh all reviewed and visibility islands explicitly../rfainbox directory creation by moving aside stale non-directory ancestors before creating the path.Testing
Deployment