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

🐛 Allow Only/Exclude/Indifferent filters for appeal status #170

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

foysalit
Copy link
Contributor

@foysalit foysalit commented Sep 2, 2024

Depends on bluesky-social/atproto#2777

Screen.Recording.2024-09-02.at.22.48.35.mov

Copy link

render bot commented Sep 2, 2024

@foysalit foysalit marked this pull request as ready for review September 2, 2024 20:54
Comment on lines 252 to 256
if (appealed) {
queryParams.appealed = appealed
// If not specifically set to true but there is a value, we can default to false
// No value will pass undefined which will be ignored
queryParams.appealed = appealed === 'true'
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if an unknown value would be better suited to be interpreted as "unset" rather than false, and some of the logic above seems to handle it that way.

Copy link
Collaborator

Choose a reason for hiding this comment

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

E.g. something like:

        if (appealed === 'true') {
          queryParams.appealed = true
        } else if (appealed === 'false') { 
          queryParams.appealed = false
        }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm... I think I see what you mean but params.get returns null and setting it to an "unknown" value feels odd and could only be needed if we ever give this more meaning in which case we'd need another touchpoint here anyways. so I'll leave it as is for now but happy to discuss more if you feel strongly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The main thing I was noticing is that in some logic (mostly the display logic) an unknown value was treated as false and in other logic it was treated as unset. So it looked like a consistency issue, e.g. the UI might display something different than what the server was receiving.

Copy link
Collaborator

@devinivy devinivy Sep 3, 2024

Choose a reason for hiding this comment

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

Trying to illustrate better! I expect the current behavior is like this:

  • ?appealed=
    • UI shows "Appeals"
    • 👍 Server doesn't filter based on appeal
  • ?appealed=true
    • UI shows "Only Appeals"
    • 👍 Server services "only appeals"
  • ?appealed=false
    • UI shows "No Appeals"
    • 👍 Server services "no appeals"
  • ?appealed=unknown
    • UI shows "Appeals"
    • ⚠️ Server services "no appeals"

In the last case there I would expect the server not to filter based on appeals, which both would match the UI and seems like a sensible way to interpret the unknown value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense. will get it wired up in the next PR! thanks

@foysalit foysalit merged commit 7452bcc into main Sep 3, 2024
3 checks passed
matthieusieben pushed a commit that referenced this pull request Sep 3, 2024
* 🐛 Allow Only/Exclude/Indifferent filters for appeal status

* 🐛 Fix page title

* Line up logic with surrounding code

Co-authored-by: devin ivy <[email protected]>

---------

Co-authored-by: devin ivy <[email protected]>
@matthieusieben matthieusieben deleted the fix-appeal-query-param branch November 15, 2024 14:55
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