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

put display mode querystring #40

Merged
merged 10 commits into from
Oct 9, 2020
Merged

put display mode querystring #40

merged 10 commits into from
Oct 9, 2020

Conversation

paltman
Copy link
Contributor

@paltman paltman commented Oct 7, 2020

No description provided.

@paltman
Copy link
Contributor Author

paltman commented Oct 7, 2020

This covers #24 and #25

Copy link
Contributor

@jacobwegner jacobwegner left a comment

Choose a reason for hiding this comment

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

@paltman This works great for display modes, but the "subdisplay" settings are not persisted in the URL.

"subdisplay" as referenced in scaife-viewer/frontend/#25 (and discussed in this comment on #26 pertains to any toolbar or selection options within a display mode.

So if I'm viewing a passage in "map mode" (/explore-homer/urn:cts:greekLit:tlg0012.tlg001.perseus-eng4:2.480?mode=named-entities), we should persist that I've chosen to view the map in parallel:

image

or in "alignments" mode, that I've selected the sentence level alignment:
/explore-homer/urn:cts:greekLit:tlg0012.tlg001.perseus-grc2:1.1-1.7?mode=alignments

image

Other examples I can think of off the top of my head (but double check each display mode component):

  • "Folio Images" also has subdisplay state (for which columns are shown)
  • "Syntax trees" (what is expanded / collapsed)

(And I'm open to introducing a better name than subdisplay if you have any ideas...maybe just calling it display mode state is clearer)

@paltman
Copy link
Contributor Author

paltman commented Oct 7, 2020

@jacobwegner should be ready to go now

Copy link
Contributor

@jacobwegner jacobwegner left a comment

Choose a reason for hiding this comment

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

Looks good.

As noted in my comments above; there may be some patterns we want to establish in the future as part of shoring up the widget "contract" (what querystring params the widget expects / how it cleans up when destroyed, cataloging options in a constants module, etc).

@paltman
Copy link
Contributor Author

paltman commented Oct 9, 2020

@jacobwegner I pushed something that encapsulates the linking so we gain:

  • only one place where the <router-link> is defined
  • only one place where we grab the query for the link
  • reader as the default name but overridable at the site level if you want to name it something different

Copy link
Contributor

@jacobwegner jacobwegner left a comment

Choose a reason for hiding this comment

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

@paltman love the encapsulation you added!

I think it also sets us up nicely if we need to further site-level overrides down the line (if we need to expose additional config, for example).

@paltman paltman merged commit 971dc04 into master Oct 9, 2020
@paltman paltman deleted the 25-display-mode-querystring branch October 9, 2020 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persist display mode / subdisplay options in querystring Refactor urn getter to read / set URN from path
2 participants