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

Fix date-marker not being removed on loading new messages #1132

Merged
merged 1 commit into from
May 5, 2017

Conversation

PolarizedIons
Copy link
Contributor

@PolarizedIons PolarizedIons commented May 3, 2017

Fixes #763 again. Affects mastrer (5eb5b99). This is caused by 648cfd1, where @astorije put it inside a container, but didn't update the class we searched for.

What it currently looks like:

Expected behavior:

Copy link
Member

@AlMcKinlay AlMcKinlay left a comment

Choose a reason for hiding this comment

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

Not tested it, but the code looks sensible. I'm guessing everywhere else we already refer to it with the correct class name now, for moving where it is, etc?

@PolarizedIons
Copy link
Contributor Author

err. Now yes :)

@xPaw
Copy link
Member

xPaw commented May 3, 2017

Looking at your gifts, looks like the viewport jumps a little when content loads now.

Copy link
Member

@astorije astorije left a comment

Choose a reason for hiding this comment

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

Woops, sorry!
I mean, pure demonstration of the extra maintenance cost of new features! :(

@xPaw, I would bet that what you pointed at, if indeed an issue, was present in the previous fix made in #765.
I would say let's merge this bugfix and figure out the jump issue separately, but I won't merge this and let you address this the way you want in case you think it should be handled differently.

@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label May 3, 2017
@astorije astorije added this to the 2.3.0 milestone May 3, 2017
@astorije astorije requested a review from xPaw May 3, 2017 11:19
@PolarizedIons
Copy link
Contributor Author

This is the behavior for bc5b03d, before this broke. Not really sure how to fix it either, tbh.

@bews
Copy link
Contributor

bews commented May 3, 2017

Current master. Does this PR fix this too?

2017-05-03_18-54-55

@PolarizedIons
Copy link
Contributor Author

Pushed the changes @xPaw, not as hard as I though 😄

@bews if those are "stuck" at the top (instead of being caused by join/parts being hidden), then yes, this should fix that.

children.eq(1).remove();
}

// get the scrollable wrapper around messages
var scrollable = chan.closest(".chat");
var heightOld = chan.height();
var heightOld = chan.height() + dateMarkerHeight; // Add the date marker's height because it was already removed
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you just get the height before removing the date marker?

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 guess I was trying to not assume anything, but it is a guarantee that there will be one at the top, so thanks. Moved calculating the height to before I remove it.

children.eq(0).remove();
} else if (children.eq(0).hasClass("unread-marker") && children.eq(1).hasClass("date-marker")) {
// Otherwise the date-marker would get 'stuck' because of the new-message marker
} else if (children.eq(0).hasClass("unread-marker") && children.eq(1).hasClass("date-marker-container")) {
Copy link
Member

Choose a reason for hiding this comment

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

Should that first one check for container too?

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 guess it isn't needed, because there will never be normal messages at index 0

@xPaw xPaw merged commit 328c619 into thelounge:master May 5, 2017
@PolarizedIons PolarizedIons deleted the fix-datemarker branch May 5, 2017 22:29
@astorije
Copy link
Member

astorije commented May 9, 2017

Unfortunately, I noticed this is still a bug in v2.3.0-rc.1 :(

date-marker-bug

@PolarizedIons, do you think you could take a look?

@PolarizedIons
Copy link
Contributor Author

Ah whoops, simple mistake, though I wish I would stop making them in PR's :\

@astorije
Copy link
Member

astorije commented May 9, 2017

It's ok, we all do, and we caught this before releasing :)

matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Fix date-marker not being removed on loading new messages
@xPaw xPaw removed their assignment Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants