Skip to content

Commit

Permalink
Add contextual help for format on save
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Nov 7, 2024
1 parent 82f8137 commit 3f99af5
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions packages/code-studio/src/settings/EditorSectionContent.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { useCallback, useState } from 'react';
import { useDispatch } from 'react-redux';
import { Switch, ActionButton, Icon, Text } from '@deephaven/components';
import {
Switch,
ActionButton,
Icon,
Text,
ContextualHelp,
Heading,
Content,
} from '@deephaven/components';
import { useAppSelector } from '@deephaven/dashboard';
import { getNotebookSettings, updateNotebookSettings } from '@deephaven/redux';
import { vsSettings } from '@deephaven/icons';
Expand Down Expand Up @@ -95,10 +103,23 @@ export function EditorSectionContent(): JSX.Element {
Enable Minimap
</Switch>
</div>
<div className="form-row pl-1">
<Switch isSelected={formatOnSave} onChange={handleFormatOnSaveChange}>
<div className="form-row align-items-center pl-1">
<Switch
isSelected={formatOnSave}
onChange={handleFormatOnSaveChange}
margin={0}
>
Format on Save
</Switch>
<ContextualHelp variant="info">
<Heading>Format on Save</Heading>
<Content>
<Text>
The Ruff settings control formatting options. Notebooks can be
formatted manually using the right-click context menu.
</Text>
</Content>
</ContextualHelp>
</div>
<div className="form-row pl-1">
<Switch
Expand Down

0 comments on commit 3f99af5

Please sign in to comment.