Skip to content

Conversation

@josephjclark
Copy link
Collaborator

@josephjclark josephjclark commented Feb 5, 2026

Description

This PR fixes intellisense and code complete in the collaborative editor (it fixes the legacy editor too)

I've basically asked Claude to copy across the legacy solution and do a little refactoring.

Closes #4386

Note that magic metadata appears to not work. I'll look at that separately.

Validation steps

  • Open a step with the common adaptor
  • Over over any operation. You should get a pop-up with docs about that function. try fn()!
  • Go to a new line. Hit ctrl+space
  • You should be presented with a list of valid operations for that adaptor

Also note that the only things in the pick list should be adaptor functions - no basic JS clutter

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@github-project-automation github-project-automation bot moved this to New Issues in v2 Feb 5, 2026

return (
<div className={cn('relative', className || 'h-full w-full')}>
{/* Loading indicator */}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO remove this stupid comment

Copy link
Contributor

@doc-han doc-han left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MIGAAA!

It works but only after I've switched the adaptor.
eg.

  1. I select a salesforce adaptor from the canvas, then I visit the job code
  2. The intellisense doesn't seem to work
  3. Now I switch adaptor from salesforce to http. I see intellisense working.

could it be that it's downloading?

@github-project-automation github-project-automation bot moved this from New Issues to In review in v2 Feb 6, 2026
@josephjclark
Copy link
Collaborator Author

@doc-han I think the problem is @latest. If the adaptor version is set to @latest then types will fail to load. If a specific version is set then it's OK.

I'll take a little look but I suspect that's an older bug - a smear in the old greatness

@josephjclark
Copy link
Collaborator Author

@doc-han I've raised out OpenFn/kit#1245 - this is a long standing bug in kit. I may raise a fix separately, I think it's cheap

@josephjclark
Copy link
Collaborator Author

@doc-han the severity of this shouldn't be too high: for new steps, when you pick an adaptor, it'll select the actual latest version, not @latest. So unless a) you have an old step which is saved to @latest, or b you specically choose @latest, it'll work just fine.

Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @josephjclark this is looking good to me, nice job 👏🏽. Noted the discussion with @doc-han about latest being tracked separately.

@elias-ba elias-ba force-pushed the make-intellisense-great-again branch 2 times, most recently from bb7738a to b6c0684 Compare February 9, 2026 01:06
CollaborativeMonaco now calls monaco.languages.typescript.javascriptDefaults.setCompilerOptions()
for intellisense. Both the global Monaco mock and the local mock in the diff test
need to provide this API to prevent "Cannot read properties of undefined (reading 'typescript')" errors.
The loadDTS function makes network calls that can fail in test environments,
causing unhandled rejection errors that make vitest exit with code 1 even
when all tests pass.
@elias-ba
Copy link
Contributor

elias-ba commented Feb 9, 2026

Fixed the failing JS tests with two changes:

  1. The Monaco mock was missing the languages.typescript API that CollaborativeMonaco now uses for intellisense. Updated both the global mock and the local one in the diff test.
  2. Also added a mock for loadDTS it was making network calls during tests that failed silently, causing vitest to exit with code 1 even though all tests passed.

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.37%. Comparing base (af21999) to head (20e38d6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4387      +/-   ##
==========================================
- Coverage   89.39%   89.37%   -0.02%     
==========================================
  Files         425      425              
  Lines       20051    20051              
==========================================
- Hits        17924    17921       -3     
- Misses       2127     2130       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josephjclark
Copy link
Collaborator Author

Thank you @elias-ba !!!

@josephjclark josephjclark requested a review from doc-han February 9, 2026 18:15
@josephjclark
Copy link
Collaborator Author

@doc-han @theroinaochieng would love to get this into the demo release tomorrow

Comment on lines 127 to 140
// Create overflow widgets container for suggestions/tooltips
if (!overflowNodeRef.current) {
const overflowNode = document.createElement('div');
overflowNode.className = 'monaco-editor widgets-overflow-container';
document.body.appendChild(overflowNode);
overflowNodeRef.current = overflowNode;

// Update editor options with overflow container
// @ts-ignore - overflowWidgetsDomNode exists but isn't in updateOptions type
editor.updateOptions({
overflowWidgetsDomNode: overflowNode,
fixedOverflowWidgets: true,
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't monaco have a default fixedOverflowWidgets which is good enough? that's what monaco uses to keep all our tooltip high in z-index. I"m wondering why we had to create a new node to be appended to body.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

This is old legacy editor code, introduced when we had problems with the z index. Feels fine without it in the collab editor. I'll cut it out

@doc-han
Copy link
Contributor

doc-han commented Feb 10, 2026

@josephjclark change log not added.

@josephjclark
Copy link
Collaborator Author

@theroinaochieng I'd like to merge this to main and release it alongside single-session AI stuff. It's got some important fixes for demos IMO. It does increase the risk and QA effort of the release though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

code assist support got dropped somewhere

3 participants