Git Product home page Git Product logo

skywriter's People

Contributors

cengels avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

skywriter's Issues

Replace QString creation with QStringLiteral where appropriate

The QStringLiteral macro creates a statically known string during compile time and should therefore be preferred if it does not contain any dynamic information.

Rules

  1. Do not use QStringLiteral() to initialize an empty string. Use QString() instead as it's more efficient.
  2. Do not use QStringLiteral() multiple times with the same contents. QStringLiterals cannot be merged into one, so this will always create multiple QStringLiterals.
  3. Do not use QStringLiteral() as an argument to a function that accepts a char* argument. In those cases, passing a simple quoted string will forego initializing a QString altogether and work with a simple char* instead.

Localization

Strings should be extracted and localized depending on the user's language.

Loading/parsing performance

This issue is a catch-all thread to diagnose and fix all and any problems related to the loading or parsing performance.

Context menu

This issue concerns the implementation of a right-click context menu in the text area.

Scene Breaks

Linked with and depends on #9.

Description

Consider whether an explicit scene break would make sense. Internally this could be stored as a simple h6 heading with a specific text (such as ###### [scene break]). In the text area, the scene break could then be displayed via a horizontal line cutting through the entire text area, or one of the more common manuscript formats for scene breaks like triple hashes (# # #).

Thoughts

  • A horizontal line might disrupt the text flow too much, especially if it's more visible than a chapter break. The line might instead have a smaller fixed width, not much wider than the three hashes.
  • If three hashes are displayed in the text area, it does not make sense to implement special behaviour for this. Users could instead just use a heading of their choice and type the three hashes manually.

Spellcheck Support

Description

The application should automatically check spelling as words are typed.

Checklist

  • A dictionary containing a list of correct words. How to obtain this dictionary?
  • A way to detect if a word is similar to a correct word and suggesting this word as a replacement.
  • An option to turn off spellcheck.
  • A way to add custom words to the dictionary on an application-wide basis.

Scene breaks are discarded upon load

Scene breaks are correctly saved to the resulting markdown file. However, when loading the file afterwards, the scene breaks are ignored by the parser and don't show up in the text area. When saving the file again, the scene breaks are lost forever.

Export without comments

It makes sense to add a function that allows one to export the file (as .md) without any of the comments. The resulting file can then be converted to a .doc file or another format and sent to beta readers and critique partners. At this stage of the draft, it is not unlikely for comments to still persist in the document. Some of these comments may be about issues the writer seeks input from their beta readers from.

This shouldn't be too difficult to implement. The text area already knows what a comment is. The parser simply has to ignore those parts of the text and additionally make sure that it doesn't leave any gaps (like double spaces because the comment was surrounded by spaces on both sides).

Preferences Menu

Description

A preferences page for the user to set various settings for the application.

Unit tests

It is time to add some unit tests to prevent regressions on future changes.

Drag and drop

The user should be able to drag text and drop it somewhere else in the text area.

Custom heading formatting

The user should be able to customize the style of the six headings by setting things like text-transform (all uppercase, small caps, ...), font-size, and font-family. For easier access, they should also be able to rename them.

Rework document structure

The document structure currently suffers from a significant performance issue. Whenever the document structure is refreshed (by calling refreshDocumentStructure(), that process takes a significant amount of time (over 100 ms). It has already been "optimized" in such a way that the document structure is not updated every time the user types something by checking whether an update to the document structure is actually necessary, but some actions (like undoing or redoing) still require a document structure refresh because it is not conventionally possible to check what changed after those actions. For instance, holding CTRL+Z currently results in significant lag after each undo.

To fix this, either

  1. diagnose the performance issues with refreshDocumentStructure() and, if possible, fix them
  2. make the refreshDocumentStructure() function asynchronous
  3. find a different way to accurately represent the document's structure without having to manually rebuild its structure each time a bigger change is made.

This issue is a part of #32.

Progress Overview

The menu entry Progress... should be populated. When clicked, it should open a new window that lists all the recent progress items and/or the word counts and words/hour statistics per day.

Show session writing time

Rather than just printing the words per day, the UI should also at least show how long the user has been writing in this session.

This should probably be a toggleable feature, as it might be distracting to some.

Document Outline

Description

Assuming a cleanly structured document where each section is prefixed by a corresponding heading, give the user an outline of the sections for easy navigation along with the word count per section.

Extreme performance impact in large files

Check the performance in large files. In skywriter-javafx a VirtualizedScrollPane was used that only rendered the text actually on the screen. In Qt, such a component does not exist, but it is possible that Qt somehow handles this problem internally automatically. If that's the case, no further action is required.

This issue also concerns the parsing performance of large Markdown files.

Work formatting into TextFormatter

At the moment the theme's formatting information (including font style, size, and color) is directly applied to the underlying QTextDocument's text blocks. This is not the right approach. Only user-defined and undoable formatting data should be applied this way. General formatting data should be applied using QTextLayout's additionalFormats, which is also the way QSyntaxHighlighter applies its syntax highlighting, so it seems reasonable to use the TextFormatter (which inherits from QSyntaxHighlighter) for this purpose.

The biggest hurdle for this improvement is the fact that QSyntaxHighlighter (and the underlying QTextLayout) only support setting document-wide QTextCharFormats, not QTextBlockFormats. This means that this approach cannot be used for block formats (especially for headings and scene breaks) and a different approach must be used that nonetheless also does not add a new undo stack.

The other hurdle is that it is not possible to change the text inside slots for either the QTextDocument::contentsChange() or QTextDocument::contentsChanged() signals. Modifying the document in those blocks results in a corrupted undo/redo stack. May be related to the filed Qt bug 13936. Unfortunately that issue has been open since 2010, so it seems unlikely it will ever be fixed. There may be no other choice than to disable the undo/redo that QTextDocument offers and implement a custom undo manager instead. That would be a ton of work for a minor bugfix though. (EDIT: After more testing, it seems like the bug is not caused by the contentsChange() or contentsChanged() signal but is actually a general bug with QTextCursor::joinPreviousEditBlock() when used in combination with QTextCursor::setBlockFormat(), which in the joinPreviousEditBlock() call to essentially be ignored and for two undo states to be created).

This fixes the following bugs:

When switching themes, empty paragraphs will maintain their original theme

This is especially noticeable on themes with different fonts/font sizes. Non-empty paragraphs will properly switch their fonts and font sizes. Empty paragraphs will, however, maintain the theme used at the start of the application, even when the user types something.

After switching themes, using the undo command changes the font formatting back, but not the colors

This essentially results in a corrupted active theme.

Introduce an "unsupported Markdown features" warning

When opening a Markdown document that features language constructs Skywriter does not support (such as lists, which are missing an empty line between the list items), Skywriter should pop-up a warning, telling the user that their data may be lost if they attempt to open this document and subsequently save it.

Highlight current paragraph

Highlighting the current paragraph is useful to minimize surrounding distractions.

This is a low priority but should be a feature at some point.

Proper noun handling

When writing a story, it is inevitable to make use of proper nouns, i.e. names, often of imaginary things, places, and people.

This proposal discusses whether and in what form these names should receive special handling in Skywriter.

Spellcheck

In order to not be falsely highlighted by the spellcheck feature, names must be ignored by the spellcheck. Users must therefore already add these names to Skywriter's internal data in some way, making further special handling relatively easy.

Instead of a simple "add word to dictionary" option, it may be preferable to offer a dedicated "add as name" (or categorized, e.g. "add as place", "add as character", "add as thing") option. This way the proper noun can be distinguished from potential false positives or unknown (but correct) words.

Overview

Skywriter may offer a dedicated menu which shows all the characters, places, and things the user has defined as well as offering the ability to modify or delete any of those entries. The actual user value is debatable, however.

Chapter assignment

Skywriter may offer a feature whereby characters, places, and things can be added to chapters or scenes while writing. This would offer the opportunity to show a more useful and coherent overview of which characters, places, and things appear in which chapters/scenes.

Another possibility is showing an unobtrusive overlay while writing with thumbnails (like portraits) of the characters, places, and things that show up in this scene. This way, if the user struggles to remember which characters appear in the scene, they can use this as a reference.

Incorrect "last saved" timestamp on first day of month

On the first day of the month, the "last saved" timestamp in the bottom left is incorrect if the file was last saved in the month prior. It will display something like "last saved -1 days ago" rather than "last saved yesterday at XX:XX".

In-depth word statistics

These statistics could include:

  • number of words total (already included)
  • the ten (?) most used words in the document along with their individual word counts
  • number of unique words in the document
  • words per heading
  • ...

Automatic chapter numbering

A convenience function which automatically generates a new chapter heading, automatically deriving its number from the previous chapter's number (optionally written out in text form).

Autosave

Feature 1: Autosave

In case the user forgets to save, there should be a feature that automatically saves after a configurable amount of time has passed without saving.

Feature 2: Backups

Even if the user does not choose to activate autosaves, the application should still periodically save the user's file -- but place it in the user's documents directory, timestamping it as a backup. That way, even if autosaves are disabled, the user can retrieve their document if Skywriter or their computer should crash before they do a manual save.

Improve anti-aliasing on dark backgrounds

There is very noticeable aliasing on small, light fonts on dark backgrounds. To make dark themes more accessible, reducing this problem should be a top priority. Even on light backgrounds, the aliasing can be noticed.

One possibility includes experimenting with font shadows to create the appearance of smoothed text. Instead of or in addition to offering dedicated input boxes for customizing the shadows, it could just be a check box labeled "Improve font smoothing" with the tooltip "On dark backgrounds, this option can reduce jagged font edges at the cost of slightly blurring the text."

Collect wiki pages

Collect wiki pages for content that does not reasonably fit into the README.md. The philosophy behind Skywriter is one example for this.

Option to keep caret vertically centered

A fairly simple feature whereby the caret is always automatically centered if its y value changes.

This is a user-configurable option and can be turned on and off.

Search input: line breaks

The search currently does not support matches across multiple text blocks (i.e. paragraphs).

This seems to be an issue with Qt/QML first and foremost, as calling QTextDocment::find() with a regex containing \s, \u2029, \r or \n does not result in matches being found. It's quite possible that Qt/QML escapes the backslashes before passing them on to FormattableTextArea, which would explain why they're not working, but it's also possible there is another problem at work.

The TextHighlighter also currently does not support highlighting across multiple blocks, but that part at least is easy to implement. But before it can be implemented, QTextDocument::find() needs to return the right ranges.

Setting: hide all sections except the current one

There could be a user setting to hide all sections except the one the user is currently in. That way scrolling would be easier and distraction minimal, especially if you're the kind of writer who writes out-of-order (i.e. you're not always writing from the end of the document).

Depends on #9.

Subsequent blocks are not updated when comment braces are modified

TextHighlighter (or more accurately its underlying QSyntaxHighlighter) does not automatically update the formatting of following blocks if comment braces are added or removed.

According to the source code of QSyntaxHighlighter, it should automatically reformat a block if its block state is different from the last time it was called. However, this does not seem to happen even though the block state is correctly set. Further investigation required.

It should be noted that the format is correctly set, i.e. setFormat() is called on every block where it is expected. It still doesn't update until the subsequent block has been typed in.

Export to other formats

Description

To minimize overhead, it would be nice to be able to optionally output to other formats as well, specifically .odt, .doc, and .PDF.

All of these, especially PDF, would require a predefined manuscript format the Markdown can parse into.

Text analysis

This proposal involves a text analysis mode that, when turned on, analyzes the document for possible problems.

Design

Depending on the type of problem and the range of text it addresses, the problem could either be described by interjecting text in a different color or by adding text in the margins, also in a different color. The corresponding text should also be highlighted (for instance by using yellow squigglies).

Note that this analysis mode should by no means be on by default. It must be specifically turned on by the user and does not carry over to subsequent launches, as it would otherwise violate the minimalism principle.

Possible problems

Document structure

  • Monotone sentence structure (multiple sentences in a row with the same length)
  • Confusing sentences (sentence is too long or contains too many parantheses)
  • Walls of text (paragraph is too long)

Grammar

  • Possible grammatical mistakes (could be difficult to implement as it would require a detailed grammar engine on a per-language basis; perhaps interfacing with the API of an online grammar engine could work?)

Spelling

Spelling mistakes are not a part of this proposal as these would instead be highlighted by the spellcheck feature, which is on by default.

Random crash while typing

The application randomly crashes while typing. This is a rare occurrence, but it results in massive loss of data and is therefore the highest priority.

If the cause of the error cannot be quickly discovered, an alternative would be to implement autosave to a temporary backup file in frequencies of 15 seconds apart or less.

Search highlighting modifies font properties

When the search highlights the matches, those matches will lose any font properties they originally held, including bold, italics, and font size. After releasing the highlighting, the text returns to normal.

Highlighting of Names

Description

The user may be able to define certain words that should be highlighted in a special way by the text area, for instance by colouring the names of the main characters.

This should also disable spellcheck (#7) for these words.

Thoughts

  • Consider whether such highlighting would actually add anything to the user experience or whether it would simply disrupt the distraction-free writing experience.

Undo stack is lost after theme change

This is a limitation of the Qt framework. At the moment it is not possible to temporarily disable the QTextDocument's undo manager, nor is it possible for changes to block formats to not be recorded into the current undo command (unlike char formats, which can use QSyntaxHighlighter or QTextLayout::setFormats() to accomplish this).

As a result, the function FormattableTextArea::updateDocumentDefaults() deliberately clears the undo stack after a theme change so that it is not possible to corrupt the document by undoing the new theme's block formats.

There is no easy way to work around this. The only solution I can see is to disable QTextDocument's undo manager entirely and implement a custom undo manager, but that's an enormous amount of work for comparably little payoff. Hm...

Relative dates

Dates (particularly the "last saved" date shown in the stats bar) should be relative, i.e. "last saved yesterday" etc. Hovering over this section should open a tooltip with the actual date and time.

Performance / responsiveness to inputs

This issue is a catch-all issue to diagnose and fix all and any problems related to the performance and/or the general input responsiveness in Skywriter.

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.