Skip to content
Closed
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
28 changes: 28 additions & 0 deletions frontend/src/components/app-config/user-config-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,34 @@ export const UserConfigForm: React.FC = () => {
</div>
)}
/>
<FormField
control={form.control}
name="display.absolute_line_numbers"
render={({ field }) => (
<div className="flex flex-col space-y-1">
<FormItem className={formItemClasses}>
<FormLabel>Absolute line numbers</FormLabel>
<FormControl>
<Checkbox
data-testid="absolute-line-numbers-checkbox"
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
<FormMessage />
<IsOverridden
userConfig={config}
name="display.absolute_line_numbers"
/>
</FormItem>

<FormDescription>
Display line numbers relative to the Python script file
instead of relative to each cell.
</FormDescription>
</div>
)}
/>
</SettingGroup>
<SettingGroup title="Outputs">
<FormField
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/editor/cell/code/cell-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@

export interface CellEditorProps
extends Pick<CellRuntimeState, "status">,
Pick<CellData, "id" | "code" | "serializedEditorState" | "config"> {
Pick<
CellData,
"id" | "code" | "serializedEditorState" | "config" | "lineno"
> {
runCell: () => void;
theme: Theme;
showPlaceholder: boolean;
Expand Down Expand Up @@ -88,6 +91,7 @@
languageAdapter,
setLanguageAdapter,
showLanguageToggles = true,
lineno,
}: CellEditorProps) => {
const [aiCompletionCell, setAiCompletionCell] = useAtom(aiCompletionCellAtom);
const deleteCell = useDeleteCellCallback();
Expand Down Expand Up @@ -188,6 +192,7 @@
diagnosticsConfig: userConfig.diagnostics,
displayConfig: userConfig.display,
inlineAiTooltip: userConfig.ai?.inline_tooltip ?? false,
cellLineno: lineno,
});

extensions.push(
Expand Down Expand Up @@ -228,7 +233,7 @@
);

return extensions;
}, [

Check warning on line 236 in frontend/src/components/editor/cell/code/cell-editor.tsx

View workflow job for this annotation

GitHub Actions / 🧹 Lint frontend

React Hook useMemo has missing dependencies: 'lineno' and 'userConfig.ai?.inline_tooltip'. Either include them or remove the dependency array
cellId,
userConfig.keymap,
userConfig.completion,
Expand Down Expand Up @@ -381,7 +386,7 @@
]);

// Destroy the editor when the component is unmounted
useEffect(() => {

Check warning on line 389 in frontend/src/components/editor/cell/code/cell-editor.tsx

View workflow job for this annotation

GitHub Actions / 🧹 Lint frontend

This effect only uses props. Consider lifting the logic up to the parent
const ev = editorViewRef.current;
return () => {
ev?.destroy();
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/editor/notebook-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ const EditableCellComponent = ({
showHiddenCode={showHiddenCode}
languageAdapter={languageAdapter}
setLanguageAdapter={setLanguageAdapter}
lineno={cellData.lineno}
/>
<CellRightSideActions
className={cn(
Expand Down Expand Up @@ -1099,6 +1100,7 @@ const SetupCellComponent = ({
languageAdapter={"python"}
setLanguageAdapter={Functions.NOOP}
showLanguageToggles={false}
lineno={cellData.lineno}
/>
<CellRightSideActions
edited={cellData.edited}
Expand Down
Loading
Loading