Repository navigation
Conversation
yunhsuan0510
left a comment
There was a problem hiding this comment.
Reviewed PR #782 at 2e0cca4. git diff --check upstream/main...HEAD passed. node --test tests/browser/lobby.test.js tests/browser/history.test.js: 9 passed, 367 skipped because Playwright Chromium is unavailable. cargo test --test web session_reports_recording_availability_for_signed_in_accounts -- --exact --nocapture could not execute the httparse build script; Windows App Control blocked it (OS error 4551).
yunhsuan0510
left a comment
There was a problem hiding this comment.
Additional verified finding on the current PR head. The relevant route test could not execute here: cargo test --test web task_mode_opens_the_default_task_at_the_home_address_for_a_guest -- --exact --nocapture was blocked when Windows App Control prevented the httparse build script (OS error 4551). The route implementation and that test explicitly define the redirect behavior cited in the inline comment.
|
Add screenshots to the pull request description to illustrate your work, as @ColtenOuO suggests. Example: #349 |
Jonathas2127
left a comment
There was a problem hiding this comment.
Reviewed 2e0cca4 against #773. On WSL with Node 22.22.1 and Playwright 1.65.0, git diff --check HEAD^ HEAD passed and node --test --test-name-pattern='recording history|replay can return' tests/browser/lobby.test.js reported 5 passed and 0 skipped.
Two additional Chromium checks passed: both history actions fit at 320 px and were reachable in the expected Tab order, and successful session rechecks for the same account changed the link from visible to hidden and back to visible. The Rust integration tests were blocked during the WebRTC build because clang++ was unavailable.
2e0cca4 to
ccfcc9e
Compare
ccfcc9e to
d1af6ad
Compare
| renderSequelSuggestion(); | ||
| hideRecentPerformance(); | ||
| nodes.historyHeader.hidden = false; | ||
| nodes.deleteReports.hidden = false; |
There was a problem hiding this comment.
Delete saved reports now starts hidden in web/index.html, so this line is the only thing that brings it back when /api/reports fails on a fresh load, and no test fails if it is dropped: the error-path tests check the progress message, never the button. The new case recording history opens while saved reports are still loading already reloads the lobby with /api/reports failing and checks only the link there; asserting deleteReports.isVisible() beside that check would pin this line.
There was a problem hiding this comment.
Addressed in f0bf3858. Extended the existing test to assert that Delete saved reports becomes visible after the /api/reports failure is handled.
d1af6ad to
f0bf385
Compare
f0bf385 to
3297995
Compare
| // Keep focus on the link until the sign-out handler disables it. | ||
| await page.locator("#logout").evaluate((button) => button.click()); | ||
| assert.equal((await requested).method(), "POST"); | ||
| assert.equal(await link.getAttribute("inert"), ""); |
There was a problem hiding this comment.
Nothing in the suite fails if nodes.logout.disabled = logoutPending; is dropped from syncLobbyControls: the if (logoutPending) return guard still stops a second request, so every assertion in this test holds while Sign out stays clickable for the whole held request. Before this change the click handler disabled the button itself, and no test in tests/browser/ checks it either way. Asserting it beside the inert check pins the move:
| assert.equal(await link.getAttribute("inert"), ""); | |
| assert.equal(await link.getAttribute("inert"), ""); | |
| assert.equal(await page.locator("#logout").isDisabled(), true); |
| nodes.sequelSuggestionPick.disabled = | ||
| !historyReady || starting || accountBusy || deletingReports; | ||
| nodes.siblingSuggestionPick.disabled = nodes.sequelSuggestionPick.disabled; | ||
| nodes.logout.disabled = logoutPending; |
There was a problem hiding this comment.
While /api/logout is pending, the new logoutPending flag makes Your recordings inert but leaves Start interview and Delete saved reports enabled because accountUpdatePending() does not check it; holding the logout response in Chromium reproduced both enabled controls.
These account-dependent actions can race session invalidation. Include logoutPending in the shared account-busy guard and cover the held-logout state with a browser regression test.
There was a problem hiding this comment.
Good catch. Coordinating all account-dependent actions during sign-out is beyond the intended scope of #773. I'd prefer to keep this PR focused on recording history navigation. Could you open a separate issue to track this?
There was a problem hiding this comment.
The flag is introduced by this pull request and applied to one control only, so a held sign-out leaves Start interview and Delete saved reports live while Your recordings is already locked. Please add logoutPending to accountUpdatePending() so the account-busy guard covers it, and add a browser test that holds the /api/logout response and checks that Start and Delete are disabled. Since reportDeletesBlocked() reads the same guard, the row delete buttons follow without another change.
There was a problem hiding this comment.
Added logoutPending to accountUpdatePending(). Browser tests verify that Start interview, bulk deletion, and individual report deletion are disabled while /api/logout is pending.
If the logout request never settles, these controls remain disabled. As agreed, timeout and recovery handling are deferred to #864.
3297995 to
f2b2249
Compare
| moveFocusOut(nodes.sessionHeading, nodes.recordingHistory); | ||
| nodes.recordingHistory.hidden = true; | ||
| } | ||
| nodes.historyHeader.hidden = nodes.deleteReports.hidden; |
There was a problem hiding this comment.
No test fails if this line is dropped. With no saved reports the header exists only to hold Your recordings, so during a held session recheck (a back/forward restore) the link goes hidden while Interview progress stays on screen with no control beside it. The restore test asserts the link is hidden while /api/session is held but never the header, and the other header assertions run after the check has settled and showProgress has rewritten it. Asserting #history-header is hidden beside the link check in restoring the lobby moves focus before hiding the recording history link pins it.
|
Some review comments on this pull request are not settled yet. Please refine the change per the review comments listed below, reply on each thread with what you changed or why you did not, and mark each thread resolved yourself once it is settled (Resolve conversation, at the bottom of the thread). The pull request stays blocked while review threads are open. Addressed at the current head; reply with what changed and resolve:
Checked at f2b2249. |
| <div id="history-header" class="history-header" hidden> | ||
| <h2 id="progress-title">Interview progress</h2> | ||
| <a | ||
| id="recording-history" |
There was a problem hiding this comment.
.history-header lays out with justify-content: space-between, and the link is now a third child between the title and Delete saved reports. With the button shown the link sits in the middle of the row; with no saved reports the button is hidden and the link jumps to the right edge. It moves every time a report is saved or deleted, and it is closer to the title than to the other action it belongs with.
Pin it beside the button instead, so both actions stay at the end whatever is visible:
#recording-history {
margin-left: auto;
}With margin-left: auto the link takes the free space and the button follows it, and with the button hidden the link stays at the right edge as it does now.
f2b2249 to
06af6fe
Compare
| await back.waitFor(); | ||
| assert.equal(await back.getAttribute("href"), "/index.html"); | ||
| await more.waitFor(); | ||
| assert.equal(await rows.count(), 20); |
There was a problem hiding this comment.
Could we also test the error path? Have GET /api/recordings return 500, wait for the error message, then verify that Tab focuses “Back to lobby” and Enter returns to the lobby.
There was a problem hiding this comment.
Back to lobby is a native HTML link independent of the recordings API, and the existing test already verifies keyboard navigation. Is there a specific risk that the current tests do not cover?
Recording history is undiscoverable even when the server can serve it. Limit the entry point to signed-in users with an active recorder, so deployments without recording do not advertise an unavailable feature. Replay also needs a direct return path when opened independently. Close sysprog21#773 Change-Id: I95232d7460c76b201727b584f29b9150dc81b0f2
06af6fe to
9e001f1
Compare
Summary
recordingAvailablein/api/sessionbased on the active recorder.Your recordingsbeside Interview progress only when the session confirms availability, without waiting for saved reports.Back to lobbynavigation to Replay.Tests
./scripts/test.sh rustpassed.scripts/git-post-commit.sh.Screenshots captured from the actual CodeTrial UI using Playwright with mocked session data.
Close #773
Summary by cubic
Makes recording history reachable from the lobby and adds a return path from Replay, so recordings aren't buried behind saved-report loading or a direct URL visit. Closes #773.
/api/sessionreportsrecordingAvailableonly for signed-in sessions with an active recorder and a verified email; the signed-out response omits the field.Your recordingsnext to Interview progress as soon as the session confirms availability, without waiting for saved reports, and hides it again on sign-out or session loss.Back to lobbylink, reachable by click or keyboard even when opened directly.Written for commit 9e001f1. Summary will update on new commits.