You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(ui): the devices page's test moves out of line, as the conventions ask - #607
crates/ui/src/settings/sessions.rs ended in a 38-line inline test block. docs/dev/rust-conventions.md lets a test block stay inline only up to 30 lines, so this one belongs in a sibling tests.rs.
The module is now settings/sessions/mod.rs, and its test is in settings/sessions/tests.rs, unchanged apart from indentation. git diff -M shows the rename.
Tests merged or removed: none. The same test still runs as settings::sessions::tests::devices_of_one_name_are_signed_out_by_different_names.
Files outside the Pages area: none.
Proof nothing changed: the component code didn't change, so no page's markup did either.
Checks: just fmt, cargo clippy -p sourceorigin-ui --all-targets with and without --all-features, cargo doc -p sourceorigin-ui with -D warnings, cargo test --doc -p sourceorigin-ui and just test -p sourceorigin-ui --all-features (9 passed).
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
This pull request moves the inline test module out of crates/ui/src/settings/sessions.rs into its own file. The module file is now crates/ui/src/settings/sessions/mod.rs.
sessions/mod.rs (renamed from sessions.rs, 86% similarity): removes the inline mod tests block (39 lines) and declares mod tests;.
sessions/tests.rs (new file): contains the moved test devices_of_one_name_are_signed_out_by_different_names. The body matches the removed block. Only the indentation changed.
Net change: 38 lines added, 39 removed. No production logic changed. The test name and assertions are unchanged.
Not verified: the reported checks (just fmt, clippy, cargo doc, doc tests, and just test). Their results were not available from the inspected diff.
No actionable comments were generated in the recent review.
Walkthrough
The sign-out label test moved from an inline module to an external test module. It checks the expected label prefix, absence of a middle dot, and distinct labels for two device rows with different IP addresses and authentication times.
Changes: Session sign-out label test
Layer / File(s)
Summary
Externalize sign-out label test crates/ui/src/settings/sessions/mod.rs, crates/ui/src/settings/sessions/tests.rs
The test is declared as an external module. It checks the expected Firefox/Linux, Passkey, and IP prefix, confirms that the label contains no middle dot, and compares labels for rows with different IP addresses and authentication times.
This change only moves a test into its own file to follow the repository's test-size convention. It does not change runtime behavior, so merging carries no meaningful risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title uses the conventional commit form and names the change: the devices page test moves out of the module into its own file. It matches the summary, which shows sessions.rs became sessions/mod.r…
Description check
The description follows the template's main sections in substance. 'What and why' explains the 38-line inline test block, the 30-line limit in docs/dev/rust-conventions.md, and the move to tests.rs. I…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title uses the conventional commit form and names the change: the devices page test moves out of the module into its own file. It matches the summary, which shows sessions.rs became sessions/mod.rs and the inline test block moved to tests.rs. The 'refactor' type fits a move with no behavior change. It does not name the crate, but that is optional.
Full details: Description check
Explanation
The description follows the template's main sections in substance. 'What and why' explains the 38-line inline test block, the 30-line limit in docs/dev/rust-conventions.md, and the move to tests.rs. It links the work to #544 with 'Part of #544', but it does not use the template's 'Closes #' form, which is acceptable for a partial change. 'Testing' lists the commands run, the test name, and the 9 passing tests, and it states what was not tested only in part (no device or live-provider testing applies here). The checklist is absent. The description does not tick any checklist items, and it does not confirm that 'just validate' passed or that generated files were regenerated, although the change likely needs neither. The description also says 'Files outside the Pages area: none', which covers scope. The gaps are minor and non-critical, so the description is mostly complete.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
A rabbit checks each label in the row Two different addresses make them show The middle dot is nowhere in sight Firefox and Linux read just right The tests hop out to a file of their own
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 9600bf7f-fe63-4704-9796-2e6738bb2edf
Commits
Reviewing files that changed from the base of the PR and between 467e813 and d95cf16.
Files selected for processing: 2
crates/ui/src/settings/sessions/mod.rs
crates/ui/src/settings/sessions/tests.rs
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Part of #544
crates/ui/src/settings/sessions.rsended in a 38-line inline test block.docs/dev/rust-conventions.mdlets a test block stay inline only up to 30 lines, so this one belongs in a siblingtests.rs.The module is now
settings/sessions/mod.rs, and its test is insettings/sessions/tests.rs, unchanged apart from indentation.git diff -Mshows the rename.settings::sessions::tests::devices_of_one_name_are_signed_out_by_different_names.just fmt,cargo clippy -p sourceorigin-ui --all-targetswith and without--all-features,cargo doc -p sourceorigin-uiwith-D warnings,cargo test --doc -p sourceorigin-uiandjust test -p sourceorigin-ui --all-features(9 passed).Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)
This pull request moves the inline test module out of
crates/ui/src/settings/sessions.rsinto its own file. The module file is nowcrates/ui/src/settings/sessions/mod.rs.Scope: settings sessions module (
crates/ui/src/settings/sessions/)sessions/mod.rs(renamed fromsessions.rs, 86% similarity): removes the inlinemod testsblock (39 lines) and declaresmod tests;.sessions/tests.rs(new file): contains the moved testdevices_of_one_name_are_signed_out_by_different_names. The body matches the removed block. Only the indentation changed.Net change: 38 lines added, 39 removed. No production logic changed. The test name and assertions are unchanged.
Not verified: the reported checks (
just fmt, clippy, cargo doc, doc tests, andjust test). Their results were not available from the inspected diff.