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

WIP: Quick filter all files #2521

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

harshad1
Copy link
Collaborator

@harshad1 harshad1 commented Feb 6, 2025

This PR adds 2 new features:

  1. a quick filter - search for all files in the notebook by tapping on the title.
  2. Share files into markor to attach them to documents. From download folder for example. Files will be copied into notebook like the usual file attachment system

Also included are a ton of fixes and improvements:

  • File browser sorting and loading (especially special folders)
  • Improved delete dialog
  • Speed improvements (2-3x) for the search (on my device at least)
  • undo / redo will track file load

@@ -284,6 +282,9 @@ protected void onFragmentFirstTimeVisible() {
public void onResume() {
loadDocument();
_webView.onResume();
if (_editTextUndoRedoHelper != null && _editTextUndoRedoHelper.getTextView() != _hlEditor) {
_editTextUndoRedoHelper.setTextView(_hlEditor);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We simplify loadContent and allow the undo-redo tracker to undo file load.

@@ -1022,4 +1022,8 @@ public boolean onReceiveKeyPress(final int keyCode, final KeyEvent event) {
}
return false;
}

public static class HeadlineState extends GsSearchOrCustomTextDialog.DialogState {
public final List<Integer> disabledLevels = new ArrayList<>();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moving action-button specific things out of the Dialog implementation

@@ -1,89 +0,0 @@
/*#######################################################
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Replaced by just using GsSearchOrCustomTextDialog


if (depth < _config.maxSearchDepth && dir.canRead()) {
handleDirectory(dir, trimLength, depth, stack);
publishProgress(stack.size(), depth, _result.size(), _countCheckedFiles);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Primary speedups:

  1. Publish progress a little less frequently
  2. Switch to stack vs queue, and simplify nesting
  3. Only get canonical file when absolutely required (this is a huge bottleneck on android)

confirmDopt.messageText = title;
confirmDopt.isSearchEnabled = false;
confirmDopt.callback = (s) -> {
showConfirmDialog(activity, R.string.confirm_delete, title, null, () -> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Generic confirm dialog which can be used everywhere

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.

2 participants