Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions frontend/src/components/SettingsModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,30 @@ const extensionSettings = {
},
],
},
{
name: 'field_notes',
description: 'Field notes settings',
icon: 'box',
builtin: false,
agents: [],
workflows: [],
settings: [
{
name: 'notebook',
label: 'Notebook',
help: '',
type: 'str',
value: 'default',
default: 'default',
choices: null,
section: '',
visibleWhenField: '',
visibleWhenValue: null,
secretSet: null,
overridden: false,
},
],
},
],
}

Expand Down Expand Up @@ -167,6 +191,15 @@ describe('SettingsModal extension fields', () => {
expect(await screen.findByText('No browser sessions yet.')).toBeTruthy()
})

it('spells an underscored app name out in the rail and its options group', async () => {
stubFetch()
renderModal()

fireEvent.click(await screen.findByRole('button', { name: 'field notes' }))

expect(screen.getByText('field notes options')).toBeTruthy()
})

it('renders every 422 message under the field named by the backend', async () => {
stubFetch()
const onClose = renderModal()
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
type UpdateUserSettingsRequest,
type WorkflowSettingField,
} from '../api/types'
import { extensionLabel } from '../extensions/registry'
import { absTime, relTimeFromIso } from '../lib/format'
import { harnessColors } from '../lib/harnessColors'

Expand Down Expand Up @@ -363,7 +364,7 @@ export function SettingsModal({ open, onClose }: Props) {
<span className="ni-glyph">
<ExtensionGlyph name={extension.icon} />
</span>
<span className="ni-label">{extension.name}</span>
<span className="ni-label">{extensionLabel(extension.name)}</span>
</button>
))}
</nav>
Expand Down Expand Up @@ -2162,7 +2163,7 @@ function ExtensionPane({

{optionFields.length > 0 && (
<div className="set-group">
<div className="set-group-label">{extension.name} options</div>
<div className="set-group-label">{extensionLabel(extension.name)} options</div>
{sectionLabels
.map((sectionLabel) => ({
sectionLabel,
Expand Down