Skip to content

fix completions in slides view#9769

Open
Light2Dark wants to merge 3 commits into
mainfrom
sham/fix-completions-slide
Open

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

Conversation

@Light2Dark
Copy link
Copy Markdown
Collaborator

@Light2Dark Light2Dark commented Jun 3, 2026

📝 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
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

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

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants