Giter Site home page Giter Site logo

roamsr's Introduction

roamsr's People

Contributors

aidam38 avatar hungriesthippo avatar lboller avatar luccahellriegel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

roamsr's Issues

How to write List Prompts

Hi! Great plugin. Wanted to ask, how do y'all write List Prompts? Currently I'm using something like this:

image

Which feels a bit hacky, but does do the job well. Have any of you found a better approach?

Add offline variant to docs

I'd like to have to offline variant in my graph, so I can be assured I can repeat when I'm not connected to the internet.
I'm not sure which pieces to add from the repo. Can you update the page on Roam Depot, please?

How do you keep your references unpolluted with sr ?

Am using roam/sr plugin, which does spaced repetition of blocks that contains the tag #sr (customizable).
The problem am facing now, whenever i do reviews of my #sr blocks then a reference gets built up internally. Over the period, looks like, the blocks in my roam graph is having more references of this sr plugin that of my own. Whenever i see a reference in the side, it is always related to sr plugin and it is kind of annoying. Any ways to over come this ?
Am sorry, if i had poorly explained.. may be you can understand it quicker by viewing this https://snipboard.io/d9DCLq.jpg

refactoring ideas

Just want to say this is not a criticism of the code! It's not unmanageable. Mostly I think it's a fun example for a more functional/reactive style.

First: defining the state

{
  inSession: boolean
  cardsToReview: Card[], // current card at 0
  answerRevealed: boolean
}

a sketch of the main loop

state.cardsToReview = loadCards();
while (state.inSession && state.cardsToReview.length) {
  await render(state);
  const card = state.cardsToReview[0];
  let [answerRevealed, signal] = await showAnswerOrSkip(card);
  if (answerRevealed !== state.answerRevealed) {
    state.answerRevealed = answerRevealed
    await render(state);
  }
  signal ||= await getResponse(card);
  updateHistory(card, signal);
  state.cardsToReview.splice(0, 1);  // or pass cardsToReview to updateHistory
  state.answerRevealed = false;
}
render(state);

Let me know what you think. My customization stuff coming soon may help motivate the changes.

Code is not properly displayed after clicking "Show Answer" because CodeMirror doesnt work with "display:none"

TL;DR: if possible switch the hiding method from "display:none" to "visibility: hidden", because otherwise code-blocks are rendered wrong

Hi!

First of all, thanks for your plugin. I really want to use it, but I stumbled upon a bug with displaying an answer that includes code.

image

I did a little digging in your code-base and I found the problem.
In "roamsr.showAnswerAndCloze" you use "display:none" to hide the answer-block.
This is not possible with a code-block because CodeMirror (the editor that Roam uses) does need the elements width, height etc. to properly display the editor.

See: codemirror/codemirror5#61

There is two solutions to this problem:

  1. Roam extends their API so you can refresh the CodeMirror instance (unlikely and 2. is easier)
  2. Switch hiding-method from "display:none" to "visibility:hidden" (works if I switch the css live with code-blocks and with text-blocks)

All the best,
Lucca

Not displaying the next card after a repetition

In my review session today, after grading a card the same card would then be shown again. I had to show the answer and grade the card a second time to get to the next card. This happened about 3 times in the spaces of only 25 reviews.

It seems that it's simply the display that wasn't updated, while roam/sr correctly moved to the next card under the hood. When I finished the review session and checked my daily notes I see that there were 3 cards I didn't see during the session, but had been counted as reviewed.

I'm on Firefox. Will try test on Chrome during my next next review session.

Not switching to next card after response

I can't tell what's causing this. It doesn't happen every time, but about half the time.
There are two ways this issue happens, after I click the rating for the card:

  1. The card stays in place, with the answer visible, but with the Return. button in the upper left. If I click Return. the next card is shown.
  2. The card is prompted again for review, but if you look in the references on the right, the schedule has been actually updated. You can skip the card, but this makes the card count go down a second time.

Blocks at the bottom of the page are unclickable

After "show answer", I sometimes have many blocks, which extend to the bottom of the page. In this case, I can't click the blocks where they intersect with the button area. Could possibly be fixed by adding some margin at the bottom of the appropriate div.

Option to collapse the answer blocks

I generally rely on the breadcrumbs to form the context for the "question" and have nested #sr blocks under it.

Example

* Topic #sr
** One line definition of the topic
** Theorem  #sr
*** Theorem statement in latex
*** Derivation #sr
**** The derivation in latex

In the above case, when the topic card answer is shown, I want it's children to be collapsed, so that I don't peek into the cards in it's children. I can restructure the cards such that the definition has a separate title and card is added there instead of on the Topic line, but I feel that's redundant as the breadcrumbs by themselves provide the context for me.

I think this would involve just calling a roam api to collapse the children when the answer card is shown? I would be willing to give a pull request if someone points to the roam api and appropriate place to call it in the current codebase. (been long since I worked on javascript projects).

Review is not showing

Hi @aidam38 ,

Thanks for the amazing plugin.

For some reason the left side bar is not showing despite the sr questions show on my daily notes.

The error message is:

Uncaught (in promise) TypeError: block.page is undefined
    reviewBlockToHistoryUnit https://serene-williams-db0c75.netlify.app/js/stable.js:671
    extractHistoryFromQueryResult https://serene-williams-db0c75.netlify.app/js/stable.js:682
    queryDueCards https://serene-williams-db0c75.netlify.app/js/stable.js:735
    queryDueCards https://serene-williams-db0c75.netlify.app/js/stable.js:727
    loadCards https://serene-williams-db0c75.netlify.app/js/stable.js:878
    loadState https://serene-williams-db0c75.netlify.app/js/stable.js:1572
    init https://serene-williams-db0c75.netlify.app/js/stable.js:1714
    epB2 https://serene-williams-db0c75.netlify.app/js/stable.js:1722
    newRequire https://serene-williams-db0c75.netlify.app/js/stable.js:47
    parcelRequire https://serene-williams-db0c75.netlify.app/js/stable.js:81
    <anonymous> https://serene-williams-db0c75.netlify.app/js/stable.js:120

What could be happening ?

Thanks,
Bruno

Deleting old roam/sr/review block references

I had a question about the block references. How far back does the algorithm pull data from to determine the next review session for a block?

I would like to delete some of my older daily note pages without breaking the review schedule.

Thank you for the help!

Buttons "Again" and "Good" stopped working

Looks like it's trying to create a page that already exists:

When pressing "Again":
stable.js:1051 Uncaught (in promise)
message: "Error in create-page: Page with title 'October 2nd, 2022' already exists"

When pressing "Good":
stable.js:1297 Uncaught (in promise)
message: "Error in create-page: Page with title 'October 2nd, 2022' already exists"

No idea why this behaviour changed; Maybe there are some updates to the roamAPI?

TypeError: Cannot read property 'uid' of undefined (in roamsr.loadState)

roam/sr was working amazingly for me this morning until at some point I refreshed my Roam and I noticed that roam/sr wasn't loading anymore. There is no "Review" element in the sidebar, and in my console I'm getting the following error message:

image

error as plaintext:

stable.js:201 Uncaught (in promise) TypeError: Cannot read property 'uid' of undefined
    at stable.js:201
    at Array.some (<anonymous>)
    at isNew (stable.js:200)
    at stable.js:247
    at Array.map (<anonymous>)
    at Object.roamsr.loadCards (stable.js:243)
    at async Object.roamsr.loadState (stable.js:607)

It's almost certainly due to some new card block I introduced somewhere, but sadly I don't know exactly how or which one in order to narrow it down.

Thanks for this amazing extension!

New review items not showing up after a few days (Firefox)

I have a few dozen cards created using roamsr. The first two days I used the system, it worked as expected. Starting yesterday or the day before, I've noticed the following erroneous behavior:

When I click on either clickable portion of the roamsr UI ("start review" or the blue and green numbers), nothing happens. Both the blue and green numbers are 0 and have been for a few days. Today, that's because the [[roam/sr/review]] block in my daily notes is empty, and it's empty because I wasn't able to review yesterday or the day before.

Yesterday (Feb 17)'s [[roam/sr/review]] block has several items in it, all with #sr as a suffix. For Feb 16's [[roam/sr/review]] block, I see a mix of #sr and #sr #r/3, indicating that some review items were processed and others weren't.

The above behavior is on up to date Firefox (84.0.2) running on Mac OS 10.15.5. On Chrome (88.0.4324.150), everything works as expected. I do not see any JS console errors or warnings when trying to use Roam or roamsr.

Review of old cards stopped

This plugin has been working great so far but yesterday that changed. I haven't created new prompts in a while, but I have a stack of older ones I still want to review:

image

But when I click review, it loads for a moment and returns this outcome:

image

I haven't made any changes to the settings, script, etc. The only change I've done is to my roam theme, but the problem persists when I disable it and use the default theme.

Alternative ways of activating Review or Option to embed Study session on page

Hi Aidam38

Just wondering if there's another way to activate SRS review--maybe through a hyperlink I can insert on the daily page. I ask for this because I tend to forget to do my daily SRS practice when cards or the link to it doesn't show up on my daily page. I understand that going through your flashcards in a deck like form ala Anki is popular but implementing it this way in Roam leaves the experience feeling less integrated or not affording engagement as it's segregated in its own dedicated view. Hopefully you can consider adding something similar to Roam toolkits implementation (but with your feature set)

Thanks

Restore left sidebar after review session

Currently, roamsr hides the left sidebar during a review session but does not restore it when the session is complete.

Suggestion: restore the left sidebar after a review session by default + add an option to preserve the current behavior if the user desires

Image Occlusion JS

Hi Adam, I hope all is well.

I was using the image occlusion js with roam/sr; I would occlude the image and then nest the correct answer beneath.

However, recently I believe a Roam update may have caused the image occlusion js to not function—when you have the opportunity can you check if it's working on your end? (It's also possible that something in my graph is not playing nicely with it)

Thanks—take care!
Cesar

Feature request: Config option to leave answer in place

Would be good to have a deck level option for q/a cards that would retain the answer block in place in daily reviews.

This would allow q/a style prompts where the answer is actively developed over time, while retaining the historical record of previous iterations of the answer.

Typing in search bar triggers response

Using the online variant. If I enter one of the key binds in the search bar it triggers that response for the current card and moves to the next one.

Code: auto-hide and show toolbar

Add code below to hide toolbar when not in use, really useful when using roam/sr
(source: made modifications to original railcast theme from jmharris903)


/*RR change: SEARCH/TOOLBAR - Uncomment the following section to hide the tool bar when not in use. A great idea from @devon. Source: https://gist.github.com/devonzuegel/f54de76cbf0c0355d93e721c89f45787;
*/

#roam-right-sidebar-content > div {
border-bottom: none !important;
}
.check-container {
padding-right: 4px;
}
.roam-body-main {
height: 100% !important;
top: 0 !important;
}
.rm-topbar {
opacity: 0;
transition: opacity 200ms;
z-index: 1;
background: none;
/width: calc(100% - 40px);/
/padding: 5;/
}
.rm-topbar:hover, .roam-topbar:focus-within {
opacity: 1;
transition: opacity 200ms;
}
#right-sidebar button {
z-index: 100;
}


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.