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

Support for attachments #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiaoruoruo
Copy link
Contributor

New features:

  • Act as a file share target. Quickly capture images or files from other apps as a new note in orgzly.
  • Add one or more attachments in the note editor, from "Attach file" menu.
  • Render attachment: links, images can be rendered inline.

Three options for saving attachments:

  • Option 1: Don't copy, just link to the file in the note, this is existing behavior
  • Option 2: Copy file into a single directory specified by a pref
  • Option 3: Copy file into a ID property based directory (org-attach style)

Future work:

  • Delete attachments
  • Insert a link into note for a given attachment
  • Support for DropBoxRepo, WebDavRepo, GitRepo. Currently only DirectoryRepo is fully supported. Dropbox and Webdav have write support but not read.

Resolves

I have been using this myself locally for over a year and it works well for my use cases. Want to share with the revived orgzly community.

amberin
amberin previously approved these changes Dec 31, 2023
Copy link
Member

@amberin amberin left a comment

Choose a reason for hiding this comment

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

This looks fantastic to me. I suggest merging and creating a prerelease build ASAP, to allow for easy testing by as many users as possible.

@cbkerr
Copy link
Contributor

cbkerr commented Jan 3, 2024

Hi @xiaoruoruo,

This would be an awesome addition! I agree it would be good to get a prerelease out soon.

Running in emulator (Pixel 7 API 33) to test, I can get Options 2 and 3 working.

Here is what happens with Option 1: Don't copy, just link to the file in the note, this is existing behavior. The following text gets put into the note content.

content://com.google.android.apps.photos.contentprovider/-1/1/file%3A%2F%2F%2Fdata%2Fuser%2F0%2Fcom.google.android.apps.photos%2Fcache%2Fshare-cache%2Fmedia.tmp%3Ffilename%3D1280px-EmacsIcon.svg.png/ORIGINAL/NONE/image%2Fpng/1053993832

Cannot determine a local path to this file.

Running in an emulator, I was able to get Option 2: Copy file into a single directory specified by a pref and Option 3: Copy file into a ID property based directory (org-attach style) to add the correct link text to the note contents.

Changes requested

  1. The "Attach file" menu option only works if Option 3 is used. For options 1 and 2, the attachment is added in the list view, but when saving and re-opening the note, it does not persist.
  2. Consider renaming "Attach file" to something that can encompass "Link file" "Copy file" or "Attach file" and make it clear the behavior depends on the option.
  3. I think new behavior should be:
    • take whatever action the user has configured (link, copy, or attach)
    • add the appropriate link text to the note at the location of the cursor ([[file:image.png]] for Option 1 and 2 and [[attachment:image.png]] for Option 3)
  4. There is an extra divider liner appears even on notes that don't have attachments
    image

@cbkerr
Copy link
Contributor

cbkerr commented Jan 3, 2024

and @amberin I feel like these would be good things to address before a prerelease build

@amberin amberin self-requested a review January 3, 2024 11:30
@amberin amberin dismissed their stale review January 3, 2024 11:31

No testing done

@cbkerr
Copy link
Contributor

cbkerr commented Jan 3, 2024

Consider renaming "Attach file" to something that can encompass "Link file" "Copy file" or "Attach file" and make it clear the behavior depends on the option.
I think new behavior should be:
take whatever action the user has configured (link, copy, or attach)

I think I came up with a better idea. There could be submenus like how the "Clock" menu works now.

It could be called: "Insert file..." that goes to 3 actions: "Link file", "Copy file", and "Org-attach file"

Then go on to this like before:

add the appropriate link text to the note at the location of the cursor ([[file:image.png]] for Option 1 and 2 and [[attachment:image.png]] for Option 3)

@Wjxfi
Copy link

Wjxfi commented Jun 21, 2024

Any updates ?

@Wjxfi
Copy link

Wjxfi commented Jul 17, 2024

Any updates ? @xiaoruoruo @amberin @cbkerr
i wanted it , this rlly cool

@Wjxfi
Copy link

Wjxfi commented Aug 9, 2024

Hello

@amberin
Copy link
Member

amberin commented Aug 9, 2024

@Wjxfi Sorry, if there were any updates, you would see them in this PR. It's pretty clear where we are: @xiaoruoruo suggested code changes, @cbkerr pointed out some issues that need to be resolved, and nothing has happened since then. So, apparently, nobody has yet had the time to do the remaining work.

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.

4 participants