Skip to content

Restore usesAiAssistance property on Language Detail page#1789

Merged
rdonigian merged 1 commit intodevelopfrom
add-ai-assistance-to-detail
Mar 26, 2026
Merged

Restore usesAiAssistance property on Language Detail page#1789
rdonigian merged 1 commit intodevelopfrom
add-ai-assistance-to-detail

Conversation

@rdonigian
Copy link
Copy Markdown
Contributor

No description provided.

@rdonigian rdonigian requested a review from a team as a code owner March 26, 2026 21:26
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

📝 Walkthrough

Walkthrough

The PR adds support for displaying the usesAIAssistance field in the Language profile details. It extends the GraphQL fragment to request the new field and updates the React component to render it as a profile display property showing whether AI assistance is enabled.

Changes

Cohort / File(s) Summary
Language Profile AI Assistance Field
src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.graphql, src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.tsx
Extended the DisplayLanguage GraphQL fragment to include the usesAIAssistance field with canRead, canEdit, and value subfields. Added a DisplayProperty component in the profile UI to render the usesAIAssistance value as "Yes" or "No".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • #1786: Directly addresses surfacing the usesAIAssistance Language field in the profile details UI through both GraphQL and component updates.

Possibly related PRs

  • #1723: Adds and surfaces the same usesAIAssistance Language field through GraphQL fragments and UI displays.
  • #1766: Modifies the same LanguageDetailProfile component that is extended in this PR to display the new field.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a description explaining why this property is being restored and what it does, even a brief explanation would help reviewers understand the context.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Restore usesAiAssistance property on Language Detail page' accurately describes the main change: adding the usesAIAssistance field to the Language Detail page UI and GraphQL fragment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-ai-assistance-to-detail

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

Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.tsx (1)

101-105: Consider handling the case when the field isn't readable.

The current logic displays "No" when usesAIAssistance?.value is undefined or false. If the user lacks canRead permission, value will be undefined, and this will incorrectly show "No" rather than hiding the field entirely (which is the behavior of other secured fields in this component).

For consistency with other fields that pass raw secured values (letting DisplayProperty hide when value is undefined), consider:

♻️ Option: Check canRead before rendering
         <DisplayProperty
           label="Uses AI assistance"
-          value={usesAIAssistance?.value ? 'Yes' : 'No'}
+          value={usesAIAssistance?.canRead ? (usesAIAssistance.value ? 'Yes' : 'No') : undefined}
           loading={!language}
         />

Alternatively, if showing "No" for both false and unreadable is intentional, this can be left as-is.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.tsx` around
lines 101 - 105, The field currently forces a boolean display by using
usesAIAssistance?.value ? 'Yes' : 'No', which shows "No" when the value is
unreadable; update the render to respect read permissions by either (a) passing
the raw secured value so DisplayProperty can hide unreadable fields
(value={usesAIAssistance?.value}) or (b) conditionally render the
DisplayProperty only when usesAIAssistance?.canRead is true; locate the
DisplayProperty usage in LanguageDetailProfile and apply one of these fixes to
preserve consistent behavior with other secured fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.tsx`:
- Around line 101-105: The field currently forces a boolean display by using
usesAIAssistance?.value ? 'Yes' : 'No', which shows "No" when the value is
unreadable; update the render to respect read permissions by either (a) passing
the raw secured value so DisplayProperty can hide unreadable fields
(value={usesAIAssistance?.value}) or (b) conditionally render the
DisplayProperty only when usesAIAssistance?.canRead is true; locate the
DisplayProperty usage in LanguageDetailProfile and apply one of these fixes to
preserve consistent behavior with other secured fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a01f5bc4-0074-489b-b3a2-b3b06ea9036e

📥 Commits

Reviewing files that changed from the base of the PR and between ab287bc and 2b4e5d6.

📒 Files selected for processing (2)
  • src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.graphql
  • src/scenes/Languages/Detail/Tabs/Profile/LanguageDetailProfile.tsx

@rdonigian rdonigian enabled auto-merge (squash) March 26, 2026 21:37
@rdonigian rdonigian merged commit 4b16ad9 into develop Mar 26, 2026
7 checks passed
@rdonigian rdonigian deleted the add-ai-assistance-to-detail branch March 26, 2026 21:39
@sethmcknight sethmcknight linked an issue Mar 30, 2026 that may be closed by this pull request
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.

Language Detail: usesAiAssistance property not displayed

3 participants