Skip to content

Conversation

@ucswift
Copy link
Member

@ucswift ucswift commented Jan 20, 2026

Summary by CodeRabbit

  • New Features

    • Improved keyboard accessibility and visible focus indication for web form inputs (clear focus outline for keyboard users).
    • Refined keyboard submit/escape handling for more reliable form submission and cancel flows.
  • Style

    • Consolidated web input/select styling into a centralized web style set to ensure consistent appearance across forms.
  • Chores

    • Internal reorganization of form submission logic for cleaner, more maintainable code.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

This pull request centralizes web-specific input/select styles into new webStyles objects in two call-related components, replaces inline style usage in WebInput/WebSelect, memoizes the onSubmit handler in the New call component, adds an accessible focus-visible CSS rule, and adds an ESLint-disable in a useEffect cleanup.

Changes

Cohort / File(s) Summary
Web styling consolidation
src/app/call/[id]/edit.web.tsx, src/app/call/new/index.web.tsx
Removed inline webInput, webInputDisabled, and webSelect style objects and introduced a centralized webStyles object; updated WebInput/WebSelect usages to reference webStyles (cast as any) and removed prior StyleSheet-based web style entries.
Form submit and keyboard flow
src/app/call/new/index.web.tsx
Introduced a memoized onSubmit via useCallback and wired existing Ctrl/Cmd+Enter and Escape keyboard handling to use it; reorganized submit logic (location binding, validation, API call, toasts, navigation) and adjusted effect wiring; added an ESLint-disable comment inside a useEffect cleanup.
Global accessibility CSS
global.css
Added .web-input-accessible:focus-visible rule to provide a visible outline and subtle box-shadow for keyboard focus on inputs and textareas.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Develop #74: Overlaps edits to the same web-oriented call components and applies similar centralization of webInput/webSelect styles and submit handler adjustments.

Poem

🐇 I hopped through styles and stitched a tidy nest,
I gathered web rules and tucked them from the rest.
A callback snug, now ready to run,
Focus lights up when keys are done—
Tiny hops, big tidy zest. ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'RD-T39 Bug fixes' is vague and generic; it uses 'Bug fixes' without specifying which bugs or what the actual changes address, making it difficult to understand the primary changes from the changeset summary. Provide a more descriptive title that explains the main change, such as 'Refactor web form styling and add accessible focus handling' or 'Consolidate web input styles and improve keyboard accessibility'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/app/call/new/index.web.tsx`:
- Around line 1294-1318: The styles in webStyles remove the browser focus
indicator (outline: 'none') which breaks keyboard accessibility; remove outline:
'none' from webInput (and webSelect if present) and replace it with an
accessible custom focus style—either add new style keys (e.g., webInputFocus,
webSelectFocus) that set a visible outline/boxShadow and outlineOffset or
implement a :focus-visible rule in your CSS and apply a className to
inputs/selects so keyboard focus gets a clear visible ring while preserving
mouse appearance; update the components that use webStyles.webInput/webSelect to
apply the focus-class or focus style when focused.
♻️ Duplicate comments (1)
src/app/call/[id]/edit.web.tsx (1)

1194-1218: Same focus-outline concern as in the new-call page.

outline: 'none' removes the default focus indicator; please keep it or add a custom focus style.

Comment on lines 1294 to 1318
// Web-specific styles that use CSS-only properties
const webStyles: { [key: string]: React.CSSProperties } = {
webInput: {
width: '100%',
padding: 10,
paddingRight: 40,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
outline: 'none',
},
webInputDisabled: {
opacity: 0.6,
cursor: 'not-allowed',
},
webSelect: {
width: '100%',
padding: 10,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
outline: 'none',
cursor: 'pointer',
},
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid removing focus outline without an alternative.

outline: 'none' removes the default focus indicator, which can make keyboard navigation inaccessible. Prefer keeping the default outline unless you add a custom focus style.

🔧 Suggested change (restore default focus indicator)
  webInput: {
    width: '100%',
    padding: 10,
    paddingRight: 40,
    fontSize: 14,
    borderRadius: 8,
    borderWidth: 1,
-    outline: 'none',
  },
  webSelect: {
    width: '100%',
    padding: 10,
    fontSize: 14,
    borderRadius: 8,
    borderWidth: 1,
-    outline: 'none',
    cursor: 'pointer',
  },
📝 Committable suggestion

‼️ 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.

Suggested change
// Web-specific styles that use CSS-only properties
const webStyles: { [key: string]: React.CSSProperties } = {
webInput: {
width: '100%',
padding: 10,
paddingRight: 40,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
outline: 'none',
},
webInputDisabled: {
opacity: 0.6,
cursor: 'not-allowed',
},
webSelect: {
width: '100%',
padding: 10,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
outline: 'none',
cursor: 'pointer',
},
};
// Web-specific styles that use CSS-only properties
const webStyles: { [key: string]: React.CSSProperties } = {
webInput: {
width: '100%',
padding: 10,
paddingRight: 40,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
},
webInputDisabled: {
opacity: 0.6,
cursor: 'not-allowed',
},
webSelect: {
width: '100%',
padding: 10,
fontSize: 14,
borderRadius: 8,
borderWidth: 1,
cursor: 'pointer',
},
};
🤖 Prompt for AI Agents
In `@src/app/call/new/index.web.tsx` around lines 1294 - 1318, The styles in
webStyles remove the browser focus indicator (outline: 'none') which breaks
keyboard accessibility; remove outline: 'none' from webInput (and webSelect if
present) and replace it with an accessible custom focus style—either add new
style keys (e.g., webInputFocus, webSelectFocus) that set a visible
outline/boxShadow and outlineOffset or implement a :focus-visible rule in your
CSS and apply a className to inputs/selects so keyboard focus gets a clear
visible ring while preserving mouse appearance; update the components that use
webStyles.webInput/webSelect to apply the focus-class or focus style when
focused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/app/call/new/index.web.tsx`:
- Around line 309-317: The submit handler leaves isSubmitting true when
validation fails for priority/type; update the handler (the function that calls
setIsSubmitting) to ensure setIsSubmitting(false) is invoked before each early
return on the priority/type checks (or move validation before calling
setIsSubmitting(true) or wrap the async flow in a try/finally that sets
isSubmitting false); specifically adjust the checks around priority and type in
index.web.tsx so that setIsSubmitting(false) is called (or validation is done
earlier) whenever you call toast.error(t('calls.invalid_priority')) or
toast.error(t('calls.invalid_type')) to avoid permanently disabling the submit
button.
♻️ Duplicate comments (1)
src/app/call/new/index.web.tsx (1)

1311-1333: Accessibility concern from previous review is now properly addressed.

The webStyles object no longer contains outline: 'none'. The focus removal is now applied locally in accessibleInputStyles/accessibleSelectStyles while the web-input-accessible CSS class in global.css provides the visible :focus-visible indicator for keyboard users.

🧹 Nitpick comments (2)
src/app/call/new/index.web.tsx (2)

119-126: Unnecessary type extension for CSS-in-JS selector.

The '&:focus-visible'?: React.CSSProperties type extension is CSS-in-JS syntax (styled-components/emotion) that has no effect on inline styles. Since focus styling is handled correctly via the web-input-accessible CSS class, this type can be simplified.

🔧 Suggested simplification
   // Add accessible focus styles for keyboard navigation
   const accessibleInputStyles = {
     ...inputStyles,
     outline: 'none',
-  } as React.CSSProperties & {
-    '&:focus-visible'?: React.CSSProperties;
-  };
+  } as React.CSSProperties;

346-346: Remove unnecessary router dependency.

As flagged by static analysis, router from expo-router is a stable module export (outer scope value), not a reactive dependency. Including it doesn't cause bugs but generates linter warnings.

🔧 Suggested fix
-    [selectedLocation, callPriorities, callTypes, toast, t, router]
+    [selectedLocation, callPriorities, callTypes, toast, t]

@ucswift
Copy link
Member Author

ucswift commented Jan 20, 2026

Approve

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved.

@ucswift ucswift merged commit b776165 into master Jan 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants