cheeaun / cheeaun/phanpy

BUG: Search Shortcuts with Advanced Search Criteria Syntax

Open
#386 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
1.5k
Forks
186
Avg merge
1d 36m
Merged PRs (30d)
11

Description

**Describe the bug**
Site: phanpy.social
Instance: mastodon.social

Entering advanced search criteria, now available in Mastodon 4.2.x instances, in a Search shortcut ends up stripping out some of the common syntax when clicked from the Shortcut menu.

**To Reproduce**
Steps to reproduce the behavior:

When entering advanced search criteria syntax as a search shortcut, it accepts the syntax such as this, which works as "give me all posts with BOTH dogs and art hashtags, but cannot contain the term cat. They must have images and should not be marked as sensitive (content warning)"

`(+dogs +art -cat) has:image -is:sensitive`

But, when you click the shortcut, the value that gets populated in the search bar is stripping out the + and # so it doesn't work as expected.

`( dogs art -cat) has:image -is:sensitive`

If you have hashtags, it strips out everything.

`(+#dogs +#art -cat) has:image -is:sensitive`

Turns into this once clicked and displaying in the search bar:

`(`

**Expected behavior**
The Search Shortcut should not strip out the advanced search syntax.

I'm sneaking in a feature request here, but it would also be nice if you could name the Search Shortcut, since the advanced search criteria is not the best looking title. For example, the title of this shortcut could be "Dog Photos" or "🐶 🚫 🐱 🖼️" instead.

**Screenshots**
Shortcut being added with the appropriate syntax (this works if you paste into the search bar in Phanpy)
![Screenshot 2024-01-03 at 12 34 03 PM](https://github.com/cheeaun/phanpy/assets/6627582/f0815798-373c-4986-9903-4634591d8de4)

How it appears in the Shortcut menu, note it still shows the correct syntax!
![Screenshot 2024-01-03 at 12 33 27 PM](https://github.com/cheeaun/phanpy/assets/6627582/7d59635b-36c2-4ccf-8daa-2fe7c30f943c)

How it appears once clicked and pushed to the search input
![Screenshot 2024-01-03 at 12 33 37 PM](https://github.com/cheeaun/phanpy/assets/6627582/0fdb69b8-9405-4800-a3fc-c40b7f380d28)

**Desktop (please complete the following information):**
- OS: MacOS
- Browser firefox
- Version 2023.12.31.8aa0542

**Additional context**
N/A

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue in the search shortcut flow with `(+dogs +art -cat) has:image -is:sensitive` and the hashtag variant. Trace how a saved shortcut is placed into the search input; done means the shortcut preserves the full advanced syntax when clicked, with existing search behavior still working.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, search, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.