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

Completely refactor how date markers are inserted #1452

Merged
merged 1 commit into from Aug 29, 2017
Merged

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Aug 24, 2017

Fixes #1450 and most likely other subtle bugs.

@xPaw xPaw added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Aug 24, 2017
@xPaw xPaw added this to the 2.5.0 milestone Aug 24, 2017
Copy link
Member

@Jay2k1 Jay2k1 left a comment

Choose a reason for hiding this comment

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

Fixes the bugs that I encountered and documented in #1450. 👍

@astorije
Copy link
Member

Hey @xPaw, unfortunately...

double_date_marker

@xPaw
Copy link
Member Author

xPaw commented Aug 25, 2017

@astorije I refactored it even further, fixed your bug and found another bug which I also fixed.

@xPaw xPaw force-pushed the xpaw/refactor-dates branch 3 times, most recently from 46c7c6c to 32e37b4 Compare August 25, 2017 16:14
msg: message
}));
function buildChannelMessages(chanId, chanType, messages) {
return messages.reduce(function(docFragment, message) {
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: return messages.reduce((docFragment, message) => {

const msgTime = new Date(msg.time);

// It's the first message in a window,
// then just append the message and do nothing else
Copy link
Member

Choose a reason for hiding this comment

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

An idea for a future PR would be to display the date marker if it's the first message in a window and there is no "more" button available. Reason for this would be to remove that odd situation that #1318 shows (I know it's not creating it, just making it more obvious).

return docFragment;
}, $(document.createDocumentFragment()));
}

function appendMessage(container, chan, chanType, messageType, msg) {
function appendMessage(container, chanId, chanType, msg) {
Copy link
Member

Choose a reason for hiding this comment

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

This method could use a test or 2, but not blocking this PR obviously.

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.

Tested, works fine.

@xPaw xPaw merged commit d8f2d7f into master Aug 29, 2017
@xPaw xPaw deleted the xpaw/refactor-dates branch August 29, 2017 08:59
matburnham pushed a commit to matburnham/lounge that referenced this pull request Sep 6, 2017
Completely refactor how date markers are inserted
@AlMcKinlay AlMcKinlay removed their request for review September 26, 2017 07:56
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.

None yet

3 participants