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

[Flashcards/HTML] Use JavaScript for the Dialected Variants #122

Open
pishoyg opened this issue Aug 4, 2024 · 6 comments
Open

[Flashcards/HTML] Use JavaScript for the Dialected Variants #122

pishoyg opened this issue Aug 4, 2024 · 6 comments
Labels
dev Why: Developer experience user Why: User convenience

Comments

@pishoyg
Copy link
Owner

pishoyg commented Aug 4, 2024

You are already generating one for Bohairic / Sahidic. Create one for all dialects, it should be straightforward.
Then you get your Bohairic-first behaviour (which is requested in #102). But also, it's much simpler, cleaner, and more dialect-neutral.

@pishoyg pishoyg added p2 dev Why: Developer experience user Why: User convenience labels Aug 4, 2024
@pishoyg pishoyg added P0 and removed p2 dev Why: Developer experience labels Aug 4, 2024
@pishoyg pishoyg changed the title [Flashcards] Generate an All-Dialect Version that Displays Spellings One Dialect at a Time [Flashcards/HTML] Use JavaScript for the Dialected Variants Aug 5, 2024
@pishoyg
Copy link
Owner Author

pishoyg commented Aug 5, 2024

Note: Here are some ideas:

  • Embed links (buttons) in the dialect codes that would highlight / de-highlight the dialect codes everywhere on the page, and also all the spellings that belong to that dialect.
  • Highlight the derivation rows that are explicitly marked as part of this dialect.
  • Dim the derivation rows that are explicitly marked as belonging to other dialects but not this one.
  • Undialected derivation rows maintain a normal style.
  • While a dialect is highlighted, the next and prev links should point to the next page that has a word belonging to that dialect.
  • Maybe also display a per-dialect group of words on top for each dialect that is highlighted.

Note: You have another use case for JavaScript: #134.

@pishoyg pishoyg self-assigned this Aug 5, 2024
@pishoyg pishoyg added P1 and removed P0 labels Aug 8, 2024
pishoyg added a commit that referenced this issue Aug 11, 2024
HTML is becoming more and more essential, and these columns are
currently unused. Supporting them is an unjustified cost.
pishoyg added a commit that referenced this issue Aug 11, 2024
pishoyg added a commit that referenced this issue Aug 11, 2024
Classes are desirable for the JavaScript behaviour.
We also want the references.
pishoyg added a commit that referenced this issue Aug 11, 2024
Pick up the new "word-parsed-classify" columna, and remove
"word-parsed-no-ref".
pishoyg added a commit that referenced this issue Aug 11, 2024
It doesn't have any impact, besides a harmless error message:
```
TypeError: Cannot read properties of null (reading 'split')
```
Still, it's cleaner to avoid it.
@pishoyg
Copy link
Owner Author

pishoyg commented Aug 11, 2024

We have made great progress here!

  • From the website's perspective, this is pretty much done.
  • From Anki's perspective, we might want to consider using this feature for the decks.

pishoyg added a commit that referenced this issue Aug 11, 2024
We add "type", "spelling-comma", "dialect-comma", and
"dialect-parenthesis" classes!
pishoyg added a commit that referenced this issue Aug 11, 2024
pishoyg added a commit that referenced this issue Aug 11, 2024
pishoyg added a commit that referenced this issue Aug 11, 2024
pishoyg added a commit that referenced this issue Aug 11, 2024
pishoyg added a commit that referenced this issue Aug 13, 2024
The default rule `site_publish` creates a fixup commit and pushes it.
The dev rule `site_prepublish` only creates a commit.

This is a followup to f7d506e.
@pishoyg
Copy link
Owner Author

pishoyg commented Aug 13, 2024

Status:

  • If we can persist the JavaScript variable across notes, so Anki remembers our preferences, then it should be possible to use this to display the dialect-oriented versions of the flashcards. There are some information about variable scopes here. Otherwise, a user would have to click on the dialect code(s) in every note in order to be able to see the version that they're after.
  • Even if we accomplish the use of JavaScript for display, we can't filter out the notes that are uninteresting (because, for example, they don't contain any spellings for a given dialect). So it's likely that exporting different Anki decks will continue to be necessary.

Summary TODO:

  • Persist the list of active dialects across notes.
  • Decide whether to use this as the default display on Anki, even in the dialected versions. (We are currently inclined to.)

@pishoyg
Copy link
Owner Author

pishoyg commented Aug 13, 2024

See #181.

@pishoyg
Copy link
Owner Author

pishoyg commented Aug 14, 2024

Status:

  • The d parameter gets persisted in localStorage, so if a user clicks a dialect, it propagates through notes.
  • Once the app is closed, the d value is cleared! This is probably undesirable!
  • [Flashcards/HTML] Add a reset Button #169 requests reset functionality for both Anki and Web. There is currently none.
  • The dialected versions of the flashcards still uses the old non-JavaScript display, which lists the per-dialect spellings, rather than list all spellings and highlight the ones belonging to the dialect of interest.

Summary TODO:

  • Persist the highlighted dialects between app runs, not just across notes.
  • Add a reset button ([Flashcards/HTML] Add a reset Button #169, not here).
  • Decide whether to use this as default display for the dialected versions.

@pishoyg pishoyg removed their assignment Aug 14, 2024
@pishoyg
Copy link
Owner Author

pishoyg commented Aug 14, 2024

Deprioritizing (by unassigning) because the current status is good enough.

@pishoyg pishoyg added dev Why: Developer experience UI Why: Better user interface labels Aug 17, 2024
pishoyg added a commit that referenced this issue Aug 19, 2024
We also don't append the query parameters to the navigate URLs since
they are already stored in the local storage.

Also use the smarter `url.searchParams.set` method, instead of relying
on raw string manipulation.
pishoyg added a commit that referenced this issue Aug 21, 2024
And run `make transpile flashcards test`.
@pishoyg pishoyg added this to coptic Sep 11, 2024
pishoyg added a commit that referenced this issue Nov 18, 2024
We have been moving away from dialect variants, and we now prefer using
the same format for all dialects, relying on highlighting to focus on
certain dialects as needed.
@pishoyg pishoyg removed the UI Why: Better user interface label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Why: Developer experience user Why: User convenience
Projects
Status: No status
Development

No branches or pull requests

1 participant