Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress clock states not saved when the clocks are in a table #5

Open
Pibemanden opened this issue May 17, 2024 · 5 comments · May be fixed by #7
Open

Progress clock states not saved when the clocks are in a table #5

Pibemanden opened this issue May 17, 2024 · 5 comments · May be fixed by #7
Labels
bug Something isn't working

Comments

@Pibemanden
Copy link

As the title indicates, I am having trouble with putting the progress clocks into tables.
When the progress clocks are outside the table they will keep the state I left them in between opening and closing Obsidian.
But no matter if I save or not I cannot keep the state of the progress clock if I have it embedded inside a table (just the default no fancy plugin).

@schicks
Copy link

schicks commented Jul 18, 2024

I'm happy to pick this up if you're good with PRs. Some quick code diving makes it seem like the problem is probably here; I'm suspicious that when we dispatch this event back to obsidian it doesn't end up going to the right place (or getting through at all) in the context of a table.

@tokenshift
Copy link
Owner

PRs are more than welcome. I haven't had a chance to dig into this yet, but I suspect you're right about the cause. CounterWidget likely has the same problem.

@schicks
Copy link

schicks commented Jul 20, 2024

Some actual debugging with console logs suggests that when the inline text is in a table, we render the Clock from here rather than using ClockWidget at all. Trying to understand a little better; given that we have the inline plugin, what is the code in handleMarkdownPostProcessor trying to accomplish? Is that supposed to be doing something for the non inline clocks?

@tokenshift
Copy link
Owner

Oh, interesting. handleMarkdownPostProcessor is what's used when you're in View mode rather than Edit mode; it looks like in table cells, Obsidian is using handleMarkdownPostProcessor to render cell contents (even when it's in edit mode), rather than the widgets it normally uses in edit mode.

The Clock object in handleMarkdownPostProcessor will still emit the update event, the problem will be getting a handle to the editable source for it. The widget gives you the built in nodeFrom and nodeTo; I don't know if there's a way to get that context information from handleMarkdownPostProcessor.

@schicks
Copy link

schicks commented Jul 21, 2024

Draft PR here but still having some issues. More to discuss on the PR thread.

@schicks schicks linked a pull request Jul 21, 2024 that will close this issue
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 a pull request may close this issue.

3 participants