Skip to content

Conversation

@Light2Dark
Copy link
Contributor

@Light2Dark Light2Dark commented Jan 7, 2026

📝 Summary

before
image

after
image

🔍 Description of Changes

📋 Checklist

  • I have read the contributor guidelines.
  • 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).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@vercel
Copy link

vercel bot commented Jan 7, 2026

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

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 7, 2026 7:15pm

@Light2Dark Light2Dark changed the title always open datasource initially if connection always open datasource initially if connection & fix styles Jan 7, 2026
@Light2Dark Light2Dark changed the title always open datasource initially if connection & fix styles always open datasource panel initially if connection & fix styles Jan 7, 2026
@Light2Dark Light2Dark added the bug Something isn't working label Jan 7, 2026
Copy link
Contributor

@manzt manzt left a comment

Choose a reason for hiding this comment

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

I like the goal here of making datasources more visible when they're relevant.

One thought on the state persistence: the hasUserInteracted flag being persisted means once a user collapses the panel, it won't ever auto-open again, right? Even in future sessions with new connections?

One idea I had was to keep open sections persistent but reset interaction tracking each session:

const openSectionsAtom = atomWithStorage<OpenSections[]>(
  "marimo:session-panel:open-sections",
  ["variables"],
  jotaiJsonStorage,
);

const hasUserInteractedAtom = atom(false); // resets each session

Another would be to maybe do something "smarter" and try to auto-open when new connections appear. But I'm guessing there would be some false positives with this:

interface SessionPanelState {
  openSections: OpenSections[];
  lastSeenConnectionCount: number;
}

// then auto-open if datasourcesCount > state.lastSeenConnectionCount

Neither is blocking, just wanted to flag some more ideas.

columnLocal: "pl-5",
columnSql: "pl-13",
columnPreview: "pl-10",
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Idk if relevant anywhere, but this would make this constant readonly.

Suggested change
};
} as const;

@Light2Dark
Copy link
Contributor Author

I like the goal here of making datasources more visible when they're relevant.

One thought on the state persistence: the hasUserInteracted flag being persisted means once a user collapses the panel, it won't ever auto-open again, right? Even in future sessions with new connections?

One idea I had was to keep open sections persistent but reset interaction tracking each session:

const openSectionsAtom = atomWithStorage<OpenSections[]>(
  "marimo:session-panel:open-sections",
  ["variables"],
  jotaiJsonStorage,
);

const hasUserInteractedAtom = atom(false); // resets each session

Thanks! I like this idea and a simpler default.

@Light2Dark Light2Dark marked this pull request as ready for review January 8, 2026 04:36
@mscolnick mscolnick merged commit ca39bf6 into main Jan 8, 2026
29 of 31 checks passed
@mscolnick mscolnick deleted the sham/fix-datasource-sidebar branch January 8, 2026 18:14
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.

4 participants