GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Align mandatory 2FA and the voice player with M3 by Storypapst · Pull Request #570 · OpenResilienceInitiative/ORISO-Frontend Conversation
|
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
📝 WalkthroughWalkthroughVoice-note controls now use M3 color tokens. Mandatory 2FA opens settings directly instead of showing an intermediate reminder. Mobile setup-dialog sizing and stepper styles are tightened, with focused tests covering each change. ChangesUI behavior and styling updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TwoFactorNag
participant TwoFactorSettings
participant OverlayReminder
TwoFactorNag->>TwoFactorNag: evaluate obligatory date
TwoFactorNag->>TwoFactorSettings: open settings when mandatory
TwoFactorNag->>OverlayReminder: show reminder when optional
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/twoFactorAuth/TwoFactorNag.tsx`:
- Around line 42-50: Remove the setForceHideTwoFactorNag(true) call from the
mandatory-2FA branch in TwoFactorNag. Keep setIsShownTwoFactorNag(false),
openTwoFactorSettings(), and the return intact so location.state.openTwoFactor
remains the mechanism preventing redirect loops while allowing the nag to
re-trigger after navigating away incomplete.
In `@src/components/twoFactorAuth/twoFactorSetupDialog.styles.scss`:
- Around line 382-388: Update the &__stepLabel styles to use the existing M3
typography token or mixin instead of hardcoded 9px font and line-height values.
Remove destructive anywhere wrapping and preserve readable labels through the
existing responsive layout or horizontal scrolling behavior.
In `@src/components/twoFactorAuth/twoFactorSetupDialog.styles.test.ts`:
- Around line 14-34: Remove the source-string regex test in the responsive
layout suite for twoFactorAuth setup, including the test around dialogStyles.
Replace it with a DOM-based or visual regression test that renders the dialog at
the mobile breakpoint and verifies the applied responsive layout through
computed styles or approved screenshots.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 605cbf85-6c8a-4ff0-9a1d-b04011acde6d
src/components/message/message.styles.scsssrc/components/message/messageVoiceNote.styles.test.tssrc/components/twoFactorAuth/TwoFactorNag.test.tsxsrc/components/twoFactorAuth/TwoFactorNag.tsxsrc/components/twoFactorAuth/twoFactorSetupDialog.styles.scsssrc/components/twoFactorAuth/twoFactorSetupDialog.styles.test.ts📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}: Keep shared behavior in hooks/utilities when multiple screens need the same state, route, selection, or formatting logic.
UI changes must have accessible focus/keyboard behavior and must not rely on color alone.
Files:
src/components/twoFactorAuth/twoFactorSetupDialog.styles.test.tssrc/components/message/messageVoiceNote.styles.test.tssrc/components/twoFactorAuth/TwoFactorNag.tsxsrc/components/twoFactorAuth/TwoFactorNag.test.tsx📄 CodeRabbit inference engine (AGENTS.md)
Reuse existing design tokens, Sass mixins, and component patterns; avoid one-off hardcoded CSS for controls, active list states, focus rings, and responsive layout.
Files:
src/components/twoFactorAuth/twoFactorSetupDialog.styles.test.tssrc/components/message/messageVoiceNote.styles.test.tssrc/components/twoFactorAuth/twoFactorSetupDialog.styles.scsssrc/components/twoFactorAuth/TwoFactorNag.tsxsrc/components/message/message.styles.scsssrc/components/twoFactorAuth/TwoFactorNag.test.tsx⚙️ CodeRabbit configuration file
src/**/*.{ts,tsx,js,jsx}: Check behavior against the surrounding ORISO flow, not only types.
Flag duplicated route/state logic, missing error/loading handling,
privacy regressions around Matrix/chat/drafts, and changes that should
be expressed through shared hooks or utilities instead of local flags.
Files:
src/components/twoFactorAuth/twoFactorSetupDialog.styles.test.tssrc/components/message/messageVoiceNote.styles.test.tssrc/components/twoFactorAuth/TwoFactorNag.tsxsrc/components/twoFactorAuth/TwoFactorNag.test.tsx⚙️ CodeRabbit configuration file
src/**/*.scss: Prefer existing design tokens, mixins, and shared component states.
Flag hardcoded one-off styling when the same control/state already
exists elsewhere. Active/focus/list-item behavior should stay shared.
Files:
src/components/twoFactorAuth/twoFactorSetupDialog.styles.scsssrc/components/message/message.styles.scssLearnt from: Storypapst
Repo: OpenResilienceInitiative/ORISO-Frontend PR: 485
File: src/components/conversationCreate/conversationCreate.styles.scss:168-175
Timestamp: 2026-07-17T23:33:56.247Z
Learning: This repo uses Stylelint v15.11.0. For the `value-keyword-case` rule, `currentColor` is considered an accepted keyword under this configuration. During code review, do not flag `currentColor` based on newer Stylelint (e.g., v17) behavior; only flag violations according to the repo’s Stylelint 15.11.0 setup.
Applied to files:
src/components/twoFactorAuth/twoFactorSetupDialog.styles.scsssrc/components/message/message.styles.scss[warning] 5-11: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(
path.join(
process.cwd(),
'src/components/twoFactorAuth/twoFactorSetupDialog.styles.scss'
),
'utf8'
)
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename-typescript)
[warning] 5-8: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(
path.join(process.cwd(), 'src/components/message/message.styles.scss'),
'utf8'
)
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
(detect-non-literal-fs-filename-typescript)
src/components/twoFactorAuth/TwoFactorNag.tsx (1)
62-63: LGTM!src/components/twoFactorAuth/TwoFactorNag.test.tsx (1)
12-12: LGTM!Also applies to: 44-44, 79-105, 119-119
src/components/message/message.styles.scss (5)
1306-1310: LGTM!
1317-1320: LGTM!
1331-1339: LGTM!
1347-1351: LGTM!
1362-1367: LGTM!src/components/message/messageVoiceNote.styles.test.ts (1)
1-35: LGTM!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (todaysDate >= settings.twofactor.dateTwoFactorObligatory) { | ||
| setForceHideTwoFactorNag(true); | ||
| setIsShownTwoFactorNag(false); | ||
| openTwoFactorSettings(); | ||
| return; | ||
| } | ||
|
|
||
| setIsShownTwoFactorNag(true); | ||
| const configuredMessage = | ||
| todaysDate >= settings.twofactor.dateTwoFactorObligatory | ||
| ? settings.twofactor.messages[1] | ||
| : settings.twofactor.messages[0]; | ||
| const configuredMessage = settings.twofactor.messages[0]; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
Authorization Bypass (CWE-288)
● Entry
src/components/twoFactorAuth/TwoFactorNag.test.tsx
│
▼
● Sink
src/components/twoFactorAuth/TwoFactorNag.tsx
Remove the state update that allows bypassing mandatory 2FA.
Calling setForceHideTwoFactorNag(true) permanently silences the nag for the duration of the component's lifecycle. Because TwoFactorNag now skips the unclosable overlay and opens the settings directly, if a user navigates away from the setup page, they will not be redirected back—effectively bypassing the mandatory 2FA requirement.
Removing this state update allows the application to rely solely on location.state.openTwoFactor to prevent redirect loops while on the settings page, and correctly re-trigger the redirect if the user attempts to navigate elsewhere without completing the setup. As per path instructions, behavior must be checked against the surrounding ORISO flow.
if (todaysDate >= settings.twofactor.dateTwoFactorObligatory) {
- setForceHideTwoFactorNag(true);
setIsShownTwoFactorNag(false);
openTwoFactorSettings();
return;
}
setIsShownTwoFactorNag(true);
const configuredMessage = settings.twofactor.messages[0];
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (todaysDate >= settings.twofactor.dateTwoFactorObligatory) { | |
| setForceHideTwoFactorNag(true); | |
| setIsShownTwoFactorNag(false); | |
| openTwoFactorSettings(); | |
| return; | |
| } | |
| setIsShownTwoFactorNag(true); | |
| const configuredMessage = | |
| todaysDate >= settings.twofactor.dateTwoFactorObligatory | |
| ? settings.twofactor.messages[1] | |
| : settings.twofactor.messages[0]; | |
| const configuredMessage = settings.twofactor.messages[0]; | |
| if (todaysDate >= settings.twofactor.dateTwoFactorObligatory) { | |
| setIsShownTwoFactorNag(false); | |
| openTwoFactorSettings(); | |
| return; | |
| } | |
| setIsShownTwoFactorNag(true); | |
| const configuredMessage = settings.twofactor.messages[0]; |
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/twoFactorAuth/TwoFactorNag.tsx` around lines 42 - 50, Remove
the setForceHideTwoFactorNag(true) call from the mandatory-2FA branch in
TwoFactorNag. Keep setIsShownTwoFactorNag(false), openTwoFactorSettings(), and
the return intact so location.state.openTwoFactor remains the mechanism
preventing redirect loops while allowing the nag to re-trigger after navigating
away incomplete.
Source: Path instructions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| &__stepLabel { | ||
| font-size: 9px !important; | ||
| line-height: 12px !important; | ||
| white-space: normal; | ||
| overflow-wrap: anywhere; | ||
| } | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Avoid hardcoded typographic values and destructive word-wrapping.
Hardcoding the font size to 9px results in text that is far too small for standard legibility and accessibility guidelines, which contradicts the PR objective to keep the indicator readable on mobile. Additionally, combining overflow-wrap: anywhere with white-space: normal causes text to shatter mid-word, severely harming readability.
As per path instructions, reuse existing design tokens and avoid one-off hardcoded CSS. Please apply the appropriate M3 typography tokens (e.g., var(--m3-typography-label-small) or a relevant mixin) and rely on responsive layouts or horizontal scrolling rather than forcing text to wrap and break at 9px.
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/twoFactorAuth/twoFactorSetupDialog.styles.scss` around lines
382 - 388, Update the &__stepLabel styles to use the existing M3 typography
token or mixin instead of hardcoded 9px font and line-height values. Remove
destructive anywhere wrapping and preserve readable labels through the existing
responsive layout or horizontal scrolling behavior.
Source: Path instructions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| describe('two-factor setup dialog responsive layout', () => { | ||
| it('scopes compact columns, connectors, and wrapping to the mobile stepper', () => { | ||
| const scss = dialogStyles(); | ||
| const mobileStyles = scss.slice( | ||
| scss.indexOf('@media (width <= 520px)') | ||
| ); | ||
|
|
||
| expect(mobileStyles).toMatch( | ||
| /&__paper\s*\{[^}]*width:\s*min\(368px, calc\(100vw - 22px\)\)\s*!important;[^}]*max-width:\s*calc\(100vw - 22px\)\s*!important;[^}]*margin:\s*11px\s*!important;/ | ||
| ); | ||
| expect(mobileStyles).toMatch( | ||
| /&__stepper\s*\{[^}]*grid-auto-columns:\s*56px;[^}]*column-gap:\s*8px;/ | ||
| ); | ||
| expect(mobileStyles).toMatch( | ||
| /&__stepUnit::after\s*\{[^}]*left:\s*calc\(50% \+ 18px\);[^}]*right:\s*calc\(-50% \+ 10px\);/ | ||
| ); | ||
| expect(mobileStyles).toMatch( | ||
| /&__stepLabel\s*\{[^}]*font-size:\s*9px\s*!important;[^}]*line-height:\s*12px\s*!important;[^}]*white-space:\s*normal;[^}]*overflow-wrap:\s*anywhere;/ | ||
| ); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Replace source-code regex tests with DOM or visual regression tests.
Testing raw SCSS source code as a string using regular expressions is a severe anti-pattern. This test is brittle and will break if code formatting (such as line breaks, indentation, or rule order) changes, while providing no actual guarantee that the layout behaves responsively in the rendered CSS or DOM.
Please remove this file and rely on visual regression tests (e.g., Percy, Playwright) or assert against applied styles in the DOM using integration tests (window.matchMedia and getComputedStyle).
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/components/twoFactorAuth/twoFactorSetupDialog.styles.test.ts` around
lines 14 - 34, Remove the source-string regex test in the responsive layout
suite for twoFactorAuth setup, including the test around dialogStyles. Replace
it with a DOM-based or visual regression test that renders the dialog at the
mobile breakpoint and verifies the applied responsive layout through computed
styles or approved screenshots.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@Storypapst This PR has major concern by Coderabbit. Can you please address that?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.