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

Jump to correct heading via id, other tweaks, bugfixes #2307

Merged
merged 39 commits into from
Jul 16, 2024

Conversation

harshad1
Copy link
Collaborator

@harshad1 harshad1 commented May 25, 2024

In this PR:

  1. We have an improved jump to heading in view mode using line numbers as IDs @guanglinn please review
  2. We move the 'format link' checkbox in the share activity to the top bar (takes even less space and is easy to see and use)
  3. The todo txt filter now treats non-keyword strings as literal (case-insensitive) matches
  4. Rework and unify markdown link highlighting and parsing
  5. Fixed v2.12.2 New file Template name corresponds to wrong content #2312
  6. Fixed unable to change Todo or quick note folder #2313 - Hiding new folder icon in these dialogs
  7. If the typed in file name in the newfile dialog already exists, the dialog text colour will be red
  8. Fix how file formats are detected
  9. Save and restore file manager scroll state so that positions are maintained as one navigates
  10. Dialogs now have rounded corners

@@ -440,4 +446,58 @@ private String replaceTokens(final String markup, final Map<String, List<String>

return markupReplaced;
}

private static class LineNumberIdProvider implements AttributeProvider {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So much boilerplate for a small extension

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What this does is sets the id of every heading node to line-. This lets us jump to any heading super easily if we just know its line number.

@harshad1
Copy link
Collaborator Author

@guanglinn this PR improves how we jump to headings. We attach the heading line number as the html node id and then jump directly to it.

I think we can even use this method to sync edit and view positions in the future .

It's wip because I want to reorganize the code a little.

@harshad1 harshad1 changed the title WIP: Jump to correct heading via id WIP: Jump to correct heading via id, other changes May 26, 2024
@harshad1 harshad1 changed the title WIP: Jump to correct heading via id, other changes Jump to correct heading via id, other tweaks, bugfixes Jun 1, 2024
@harshad1 harshad1 changed the title Jump to correct heading via id, other tweaks, bugfixes WIP: Jump to correct heading via id, other tweaks, bugfixes Jun 2, 2024
@harshad1
Copy link
Collaborator Author

harshad1 commented Jun 2, 2024

Marked WIP as I found a bug when you open a file from the share into dialog

All known issues fixed now

@harshad1 harshad1 changed the title WIP: Jump to correct heading via id, other tweaks, bugfixes Jump to correct heading via id, other tweaks, bugfixes Jun 3, 2024
@gsantner
Copy link
Owner

Tried the blinking as read the question - yes much better then the last few tries. That looks OK to me.

@gsantner
Copy link
Owner

gsantner commented Jul 16, 2024

Of the rounded dialogs, personally humbly said I like it better non rounded. But I'm not strong opposed.

new Format(FormatRegistry.FORMAT_EMBEDBINARY, R.string.embed_binary, ".jpg", CONVERTER_EMBEDBINARY),
new Format(FormatRegistry.FORMAT_PLAIN, R.string.plaintext, ".txt", CONVERTER_PLAINTEXT),
new Format(FormatRegistry.FORMAT_EMBEDBINARY, R.string.embed_binary, ".jpg", CONVERTER_EMBEDBINARY),
Copy link
Owner

Choose a reason for hiding this comment

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

Is there a specific reason to move this one down again? I placed it abvoe plaintext so i.e. .m3u gets taken to that converter for music/video playlist support, all in view mode.

@gsantner
Copy link
Owner

Thank you other then those two I didn't find anything else. Thanks much for your contribution!

@gsantner gsantner merged commit 92744b3 into gsantner:master Jul 16, 2024
1 check passed
@gsantner gsantner added this to the Markor v2.13 milestone Jul 16, 2024
@harshad1
Copy link
Collaborator Author

Tried the blinking as read the question - yes much better then the last few tries. That looks OK to me.

That's good. I can work on adding things to make it even more clear if needed.

Is there a specific reason to move this one down again? I placed it abvoe plaintext so i.e. .m3u gets taken to that converter for music/video playlist support, all in view mode.

No. This was an error which I missed. Thanks for catching this and fixing it.

1 similar comment
@harshad1
Copy link
Collaborator Author

Tried the blinking as read the question - yes much better then the last few tries. That looks OK to me.

That's good. I can work on adding things to make it even more clear if needed.

Is there a specific reason to move this one down again? I placed it abvoe plaintext so i.e. .m3u gets taken to that converter for music/video playlist support, all in view mode.

No. This was an error which I missed. Thanks for catching this and fixing it.

@harshad1
Copy link
Collaborator Author

Of the rounded dialogs, personally humbly said I like it better non rounded. But I'm not strong opposed.

Google's design guides all want rounded now. If you feel that it isn't nice after some more testing we can reduce the radius to a smaller number. Feedback on this is always appreciated.

elyahw pushed a commit to writing-tools/marelias-notepad that referenced this pull request Sep 26, 2024
 by @harshad1, fixes gsantner#2312 gsantner#2313)

* Jump to correct heading via id
* No need to track lines
* As link checkbox to top bar
* Simplify heading, checkbox to title, task filter literal
* Unified and cleaned up link formatting
* new file dialog fixes, no folder in select qn / todo
* launch in new activity
* Improvement to launching activities
* Fixed + improved isFileOutOfThisFormat
* Switching from blink to ripple
* Logic to save and restore file browser position
* Can scroll action bar on repeat items
* Handle unknown formats better
* Handle virtual folders better
* Rounded dialogs, fixes for launching files
* Improved show and flash
* Improved keyboard showing
* Improved how we test for compatible files
* Cleaner way to do dialog radius
* Better showing of folders
* Rounded corners for all dialogs, cleaner structure
* Better text file detection
* Cleaner style system
* Matching colour
* Match system bars with UI colors
* Rounded widget corners, hide text actions bar

---------

Co-authored-by: Gregor Santner <[email protected]>
(cherry picked from commit 92744b3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment