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

enable/disable passage link-connectors for better performance and clear view #1451

Open
2 of 3 tasks
flarack opened this issue Sep 16, 2023 · 6 comments
Open
2 of 3 tasks
Labels
enhancement New feature or request P3 (could) Annoying bugs that have workarounds, Interesting ideas

Comments

@flarack
Copy link

flarack commented Sep 16, 2023

Is your feature request related to a problem? Please describe.

The acutal story I'm working on uses chapbook and references a global header and footer in every passage. Due to automated generation of visible passage link-connectors in the ui, the performance is getting worse with each passage to be added.
automated_passage_links

Describe the solution you'd like.

A simple solution is to add options in the settings panel to make passage link-connectors visible / invisible. Maybe even two options for:

  1. show embedded passage link-connectors [yes/no]
  2. show direct passage link-connectors [yes/no]

Describe alternatives you've considered.

Atm I delete the class="link-connectors" each time I open twine, but it's a clunky workaround. Maybe there is a solution using the user.css from twine 2.70, but I don't know how.

Additional context on this suggestion.

No response

Presubmission checklist

  • I am interested in working on code that would implement this feature request. (This is not required to submit a suggestion.)
  • I have done a search and believe that an issue does not already exist for this idea in the GitHub repository.
  • I have read and agree to abide by this project's Code of Conduct.
@flarack flarack added the enhancement New feature or request label Sep 16, 2023
@flarack flarack changed the title enable/disable passage connectors for better performance and clear view enable/disable passage link-connectors for better performance and clear view Sep 16, 2023
@greyelf
Copy link

greyelf commented Sep 16, 2023

@flarack
Could you supply an example of the code you are using currently in each of those Passages to reference the "Global" related header & footer Passages?

@flarack
Copy link
Author

flarack commented Sep 17, 2023

@greyelf It is a simple embed:

{embed passage: 'global.header'}
{embed passage: 'global.footer'}

header_footer_embed

The header is mainly used as minimal interface, the footer as "menu"

@greyelf
Copy link

greyelf commented Sep 19, 2023

@flarack
After reviewing the relevant sections of the both the Twine 2.x application's code, and that of Chapbook's Passage Editor Extension, responsible for locating "links" within a Passage's content so a related Connector Arrow can be shown, it appears that the "broken line" based connectors you mention are being generated by the Extension and not by the Twine 2.x application itself.

If this is the case then you may need to report this performance related issue on Chapbook's repository so its Developer can;

  • resolve / improve the performance issue relating to the additional Passage Connectors the Extension creates
  • add an option to the Extension's Toolbar to allow an Author to enable/disable said additional Passage Connectors.

@klembot
Copy link
Owner

klembot commented Sep 20, 2023

A couple possible workarounds:

  1. Disable editor extensions for Chapbook
  2. Add the following to user.css:
.story-edit-route .link-connectors {
  display: none;
}

@klembot klembot added the P3 (could) Annoying bugs that have workarounds, Interesting ideas label Sep 20, 2023
@flarack
Copy link
Author

flarack commented Sep 21, 2023

@klembot @greyelf Thanks a lot for your investigation. Disabling editor extensions is a near perfect solution to this issue.

@hituro
Copy link

hituro commented Oct 5, 2023

@klembot @greyelf Thanks a lot for your investigation. Disabling editor extensions is a near perfect solution to this issue.

But then you get no syntax highlighting inside the passage. I'd think the CSS route would be better.

Another option would be to add your own custom insert which is just a copy of embed with a different name, so that it won't create arrows, e.g.

engine.extend('1.0.0', () => {
	config.template.inserts = [{
		match: /^silent-embed\s+passage(\s+named)?/i,
		render(passage) {
		    return mainRender(passageNamed(passage).source);
		}
	}, ...config.template.inserts];
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 (could) Annoying bugs that have workarounds, Interesting ideas
Projects
None yet
Development

No branches or pull requests

4 participants