Skip to content

fix completions in slides view#9769

Merged
Light2Dark merged 3 commits into
mainfrom
sham/fix-completions-slide
Jun 3, 2026
Merged

fix completions in slides view#9769
Light2Dark merged 3 commits into
mainfrom
sham/fix-completions-slide

Conversation

@Light2Dark

@Light2Dark Light2Dark commented Jun 3, 2026

Copy link
Copy Markdown
Member

📝 Summary

Jedi requires cell-id props to resolve completions. This adds a fix to the slide cell editor.

Also hides the inline "Edit with AI" tooltip for slides. It's trickier to position it correctly, and I think for slides, this is a better default anyways.

image
/**
 * Completion source for Python, using Jedi.
 */
export const pythonCompletionSource: CompletionSource = async (
  context: CompletionContext,
): Promise<CompletionResult | null> => {
  const query = context.state.doc.sliceString(0, context.pos);
  const element = document.activeElement;
  let cellId: CellId | null = null;
  if (element !== null) {
    const cellContainer = HTMLCellId.findElement(element);
    if (cellContainer !== null) {
      cellId = HTMLCellId.parse(cellContainer.id);
    }
  }

  if (cellId === null) {
    Logger.error("Failed to find active cell.");
    return null;
  }

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.
Copilot AI review requested due to automatic review settings June 3, 2026 04:26
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jun 3, 2026 8:05am

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Python/Jedi autocompletions in the slides “show code” editor by ensuring the slide cell editor wrapper has the same cell-identifying DOM attributes/id convention used elsewhere in the app (so the active cell can be discovered via HTMLCellId.findElement(...)).

Changes:

  • Import and reuse cellDomProps in the slides cell editor view.
  • Apply cellDomProps(cell.id, cell.name) to the slide cell editor wrapper div so it gets an id like cell-<CellId> plus data-cell-* attributes.
@Light2Dark Light2Dark added the bug Something isn't working label Jun 3, 2026
@Light2Dark Light2Dark requested a review from dmadisetti June 3, 2026 04:41
@Light2Dark Light2Dark enabled auto-merge (squash) June 3, 2026 04:41
@Light2Dark Light2Dark merged commit d9ab41a into main Jun 3, 2026
31 checks passed
@Light2Dark Light2Dark deleted the sham/fix-completions-slide branch June 3, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

3 participants