qpixel
qpixel copied to clipboard
Flagging as duplicate to "anonymous" link is possible (Like, flagging as duplicate of https://google.com/)
For closing a question as duplicate of another one, we don't allow to close a question to "anonymous" link. But, It doesn't apply to flagging. Like, I had seen duplicate post in Meta and, Math. Then, I could flag a post as duplicate of another community's question. I was thinking if we use the same condition for flagging either. User may not flag to "anonymous" link.
You may say user might describe (in details with link) why it's related. So, we shouldn't stop user from flagging as duplicate to "anonymous" link. My opinion is, If user add description than, we just can detect link and, check that post is available in that community or not. If not, than we could simply return an error to that user
We should make "close as dupe" and "flag as dupe" use the same UI with the same error-handling. Right now flagging shows a textbox at the bottom, where you can enter anything, while closing shows the textbox right under the dupe reason, and you get a 400 error (no explanation) if you enter, say, google.com.
Eventually closing and dupe-handling will get an overhaul, but we're still designing that. In the meantime, is it feasible for them to use the same UI and input validation?
It's not feasible for them to use the same UI, because they're different processes that get handled differently, so they have two completely separate UIs. We can change the validation for them - the only catch there is that flag validation is handled generically at the moment, so we'd have to add a specific exception for the dupe flag which isn't ideal.
Ah, I see. I don't know if we want to invest in special-casing this code when (I hope) we're going to rework close/dupes anyway, so maybe we should just make sure the text in the dialogue is clear that we need a local URL and without that, the flag will probably be declined.
will try to solve... https://github.com/codidact/qpixel/blob/develop/app/controllers/flags_controller.rb#L27-L40 leaving the comment to find the page easily..
@Istiakshovon I don't think we need this one - we can rephrase the dialog text rather than adding extra special case code for this specifically.