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

Add find note by content intent #1584

Merged
merged 8 commits into from
May 13, 2024
Merged

Conversation

charliescheer
Copy link
Contributor

@charliescheer charliescheer commented May 9, 2024

Fix

So another thing that might be useful for shortcuts is to be able to find a note by its content and not its title. This intent itself doesn't do anything except for search notes and present them as an option, but if you connect it to Append Note then you can find a note by it's content, and add content to it in one shortcut. pretty cool I think. So that is what I have done in this PR.

As a bonus, While I was at it I realized that you might also want to open a note that you found based on its content. So I have updated the Open Note Intent to accept a note from other shortcuts.

This is the last planned shortcut to be added, so this:
fixes #1569
fixes #1487

Test

okay, so testing this requires a bit of understanding of shortcuts.

find and append to note

  1. build app to device to ensure the entitlements are handled correctly
  2. background the app, open shortcuts, add a shortcut and tap on add action. Find Simplenote and add Find Note With Content
  3. tap on content and choose "Ask each time" and hit done in the drawer
  4. at the bottom of the page you should see Simplenote in a hidden modal, slide that up and select Append to note
  5. tap on content and hit Ask each time
  6. now run the shortcut.
  7. type in some text you know is in one of your notes and then hit done. (note if you have two notes with the same content you will be asked to choose which note you want. Make sure to test this too)
  8. then enter in some content in the next view and hit done

Open Simplenote and confirm your text was added to your note

find and open note

  1. background the app again, open shortcuts, add a shortcut and tap on add action. Find Simplenote and add Find Note With Content
  2. tap on content and choose "Ask each time" and hit done in the drawer
  3. at the bottom of the page you should see Simplenote in a hidden modal, slide that up and select Open Note
  4. now run the shortcut.

confirm that the note you searched for is opened in Simplenote

Review

(Required) Add instructions for reviewers. For example:

Only one developer is required to review these changes, but anyone can perform the review.

Release

(Required) Add a concise statement to RELEASE-NOTES.txt if the changes should be included in release notes. Include details about updating the notes in this section. For example:

RELEASE-NOTES.txt was updated in fc201c with:

Extended support for iOS Shortcuts

@charliescheer charliescheer added this to the 4.52 milestone May 9, 2024
@charliescheer charliescheer self-assigned this May 9, 2024
@charliescheer charliescheer linked an issue May 9, 2024 that may be closed by this pull request
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 9, 2024

You can test the changes in simplenote-ios from this Pull Request by:

  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr1584-8fea6d6-018f5eee-9c73-45c0-b90a-934aeedf8727 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

Woah chained Intents, love it!!

:shipit:

// TODO: Better error
return IntentNoteResolutionResult.unsupported()
}
let filteredNotes = notes.filter({ $0.content?.contains(content) == true })
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideaaaally this happens at the Core Data level.

I haven't seen massively big accounts, but this will load all the things in memory, and run the lookup there.

Copy link
Contributor

Choose a reason for hiding this comment

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

@charliescheer ^ Good to disregard though, I don't think this should be a problem in Simplenote

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna disregard it for now I think. If we get any complaints then we can optimize

Base automatically changed from charlie/1569/add-append-new-note-shortcut to trunk May 13, 2024 22:34
@charliescheer charliescheer merged commit 127d7a4 into trunk May 13, 2024
12 checks passed
@charliescheer charliescheer deleted the charlie/1569/add-search-intent branch May 13, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add additional shortcuts Better iOS Shortcuts support
3 participants