Skip to content

Commit bdae6d3

Browse files
committed
chore(files): remove extraneous comments from file viewer and data table
1 parent a252ab4 commit bdae6d3

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/data-table.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ const DataTableBase = forwardRef<DataTableHandle, DataTableProps>(function DataT
2727
const [editingCell, setEditingCell] = useState<EditingCell>(null)
2828
const [editValue, setEditValue] = useState('')
2929

30-
// Always-current ref so the imperative handle doesn't go stale
3130
const editStateRef = useRef({ editingCell, editValue, editConfig })
3231
editStateRef.current = { editingCell, editValue, editConfig }
3332

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/file-viewer.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { DataTable } from './data-table'
2222
import type { PdfDocumentSource } from './pdf-viewer'
2323
import { PreviewPanel, resolvePreviewType } from './preview-panel'
2424

25-
// Token rules shared by both themes — override the major categories; base handles the rest
2625
const SIM_DARK_RULES: import('monaco-editor').editor.ITokenThemeRule[] = [
2726
{ token: 'comment', foreground: '606060', fontStyle: 'italic' },
2827
{ token: 'string', foreground: '3ab872' },
@@ -855,19 +854,13 @@ function TextEditor({
855854

856855
if (isStreamInteractionLocked || monacoValue === lastSyncedContentRef.current) {
857856
if (isStreamInteractionLocked) {
858-
// Measure BEFORE setValue — scrollHeight hasn't grown yet, so the
859-
// "at bottom" check is accurate. Re-engage auto-scroll if at bottom;
860-
// never disengage here (user scroll events do that via Effect 2).
861857
const scrollTop = editor.getScrollTop()
862858
const scrollHeight = editor.getScrollHeight()
863859
const { height } = editor.getLayoutInfo()
864860
if (scrollHeight - scrollTop - height < 80) {
865861
textareaStuckRef.current = true
866862
}
867863
}
868-
// Preserve the user's scroll position when they've scrolled away from the
869-
// bottom. Suppress the onDidScrollChange listener so programmatic scroll
870-
// changes (setValue / restoreViewState) don't falsely disengage auto-scroll.
871864
const viewState =
872865
isStreamInteractionLocked && !textareaStuckRef.current ? editor.saveViewState() : null
873866
suppressScrollListenerRef.current = true
@@ -885,10 +878,6 @@ function TextEditor({
885878
return
886879
}
887880

888-
// Effect 1 re-engages auto-scroll (sets true) immediately before each setValue,
889-
// measuring scroll position while scrollHeight is still accurate. This listener
890-
// only needs to disengage when the user physically scrolls away from the bottom.
891-
// Suppressed during programmatic setValue/restoreViewState in Effect 1.
892881
const disposable = editor.onDidScrollChange(() => {
893882
if (suppressScrollListenerRef.current) return
894883
const scrollTop = editor.getScrollTop()

0 commit comments

Comments
 (0)