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

recreate debug alerts branch #15705

Merged
merged 1 commit into from
Jul 12, 2024
Merged

recreate debug alerts branch #15705

merged 1 commit into from
Jul 12, 2024

Conversation

schlawg
Copy link
Collaborator

@schlawg schlawg commented Jul 12, 2024

i see the "how" argument is still in there. it's harmless for now.

i promise i'll take a hard look at cutting down the number of ways things to do things in dialog. just as soon as i arrive at a notion of the best way to do them.

const cancelOnInterval = (e: PointerEvent) => {
if (Date.now() - justThen < 200) return;
const r = dialog.getBoundingClientRect();
if (e.clientX < r.left || e.clientX > r.right || e.clientY < r.top || e.clientY > r.bottom)
Copy link
Collaborator

Choose a reason for hiding this comment

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

that might conflict with (user) tooltips, select, mselect and anything adding a layer on top of the window.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

assuming they preventDefault on the click, it shouldn't arrive on the body element. If it does, I think we still want to close in that case.

I added the bounding client rect check because non-modal dialogs don't trap background clicks for us like modal ones. That said, I'm not super attached to even allowing/supporting click away for non-modals.

@@ -74,15 +75,17 @@ export default function makeLog(): LichessLog {
};

function terseHref(): string {
return window.location.href.replace(/^(https:\/\/)?lichess\.org\//, '/');
return window.location.href.replace(/^(https:\/\/)?lichess(?:1?)\.org\//, '/');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd rather see (?:lichess|lichess1) for readability and searchability.

@ornicar ornicar merged commit 2e5d3a8 into lichess-org:master Jul 12, 2024
3 checks passed
@schlawg schlawg deleted the scratch5 branch July 15, 2024 22:40
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.

None yet

2 participants