Solara

S

Solara

Discord for the Solara python package. NOT for the Roblox executor :)

Join

questions-issues

general

announcements

Preventing parent re-renders or preventing input fields from losing their current value on re-render

Hi all. I have a Solara application where there is a separate thread (using solara.thread) that periodically performs some work and updates a text component, at some interval. In addition, there are some other components that use solara.InputInt/solara.InputFloat/solara.InputText that the user can interact with. However, if the user is in the middle of inputting a value (the cursor is located in the Input component) and the thread runs its work and updates its text component, the current value of the Input component is resetted. This makes it very hard to input values if the thread runs at .e.g. once every second, as it will just reset the value the user tries to input....

Markdown editor not entering space characters properly

When using the markdown editor, new lines will not accept spaces as input. Every time a space char is inputted, it is displayed and then immediately overwritten by whatever the user types next. However, if the space is deleted by the user by pressing backspace, the bug goes away and the editor works as intended (on that line). By looking at the raw markdown, you can see that the string " " is appended at the end of the line. It looks like the presence of that char at the end of the line fixes the bug. I tested it in both vscode and mozilla firefox (both solara server and jupyter lab) and i can reproduce in all of them....

How to cancel task?

Hello, I tried to cancel tasks which are not current and tried the following code. My expectation was, that the task will wait until the previous task is finished and if it is not current anymore, then it is canceled (From the docs: The task object will execute the function only once per virtual kernel and will only store one result per virtual kernel. When called multiple times, the previously started thread or asyncio task result will be ignored.) So my expectation was, that if I click 10-times the button when running the task for the first time, some of the tasks will be canceled and the total number of runs will be smaller than the number of clicks. What I am doing wrong? The code is shared as gist, since it does not run in pycafe, (however it works fine on local PC) and the URL generated by pycafe is too long https://gist.github.com/robert-marik/f41782f83e361636677099808cf1621a...

MarkdownEditor not displaying in vscode notebook

when using solara.MarkdownEditor in a vscode notebook, nothing is displayed (normal markdown is shown though). The same code works fine if i run the notebook as a standalone app in the browser. Any idea what could be going on? Ps: great job on solara! I love it, and it's going to make making dashboard sooo much easier!...
No description

Hide AppBar

Hello, I have multipage solara. However, the AppBar (title and menus) takes a lot of space on small monitor. Is it possible to make AppBar not fixed on the top of the screen? Thank you.

How to show progress of FileDrop?

Apparently solara.FileDrop can show the progress of the file being read. This would be great in my app as reading an excel file with few thousand lines can (in my setup) take minutes and it would be great to show progress to the user. I just can't figure out how it should be done? Documentation says this: @solara.component...

Force solara to use https in redirect uris

Using Chrome's Dev Tools, I observed the following network requests after clicking the login button in my application: Initial Login Request: https://example.com/_solara/auth/login?redirect_uri=https%3A//example.com/return_to_path This request looks correct as it uses https....

Style order

I'm having some difficulty sorting through the order of CSS loading. I'm using the Style "component" to load css files from my assets folder. They load no problem and show up in the expected order in the <head> section. However, they are overridden by vuetify classes, which I presume are somehow loaded after. But I can't see where this is happening. Post-serve JS? Could you please assist. Also, great if you have some advice regarding handling CSS, and maybe SCSS, which I am currently using...

error-empty page after execution

import solara @solara.component def Page(): # Define a reactive variable...
No description

Thread vs Task

Hey 👋 , I would like to implement chat using CrewAI and I am wondering what is the difference between use_thread and use_task. I haven't found a clear comparison in the documentation, so I'm asking if anyone would be able to explain to me the differences or give me some example use cases? For any answer I will be grateful 🫂...

Redirect URI error when testing login in solara app

Hi, I am trying to test an auth example in solara via okta. I have configured my app in okta following the solara docs and I am trying to test (locally) a simple login button. The relevant part of the snippet is ``` import solara from solara_enterprise import auth ...

How to make `slider.value` reactive?

Hi there! I have a notebook that contains two cells. I'd like to ask: How can I listen to changes in slider.value in the second cell? I don't want to modify the first cell. Suggestions are very welcome! Here's the notebook: ```py import ipywidgets as widgets...
No description

Solara Error

Hey 👋 , I have encountered a problem that I have not found in Github issues or on discord. I created a page that has a form with a dozen fields (select, input, slider) and a button at the very bottom of the page. When it is clicked, these fields are validated (that the values are not empty, etc.) and during if an exception is thrown I run solara.Error(label='message') however it is not visible anywhere (I am sure it goes into the except block in try except). I paste the simplified code below. Any help would be appreciated! 🫂 ...

Finding size of image in figure

I have a solara component with a single figure, an image. But the image I have set is autoresizing and I would like to get the size of the image or maybe the container that holds it. Any ideas?

any upcoming plans/existing ways to create guided tour functionality (solara)?

i'm interested in creating a guided tour for my app. are there any sort of upcoming plans to try and implement something like this, or would there be a way i could leverage something like this as a vue component to implement it? not sure exactly how to include/import the vue library within solara's context and get started with it, so any help/guidance would be appreciated...

any way to export solara app as an executable app?

It's not about deploying the app, but some method to make it an executable app. something simpler for the client other than installing python, libraries and source codes

How to access the user's microphone?

To be more specific, I want to use Solara as an interface for my program with Azure Speech ``` import azure.cognitiveservices.speech as speechsdk ...

use_exception

Can anyone provide a simple example of how to use the use_exception hook? The demonstration on the documentation page generates an infinite render loop when the test exception is generated and does not recover....

process results of a field change to another element level

I would like to trigger python code each time one of the input fields in a page is updated, the result of the python code should be shown in a message box at Page() level. https://py.cafe/rob.on.lists/solara-markdown-message-editor I know how to display a reactive variable in a field on Page(), when it is changed/set in another element, but I can't get my mind around triggering python statements. Should I propagate the on_value condition from the propagate() routine up to MarkDownEditor elements in Page()? How do you propagate conditions?...