aaronpk / Monocle

Monocle is a reader app that talks to a Microsub server
https://monocle.p3k.io
MIT License
49 stars 8 forks source link

Summary not displayed if item has name property #41

Open jackjamieson2 opened 5 years ago

jackjamieson2 commented 5 years ago

I think this is probably a monocle bug, but I might be interpreting incorrectly.

For some posts, the 'summary' field is not displayed even when it seems to be populated correctly

Example 1

Screen Shot 2019-05-30 at 2 45 59 PM
{
    "type": "entry",
    "name": ""I met you at a house party in Montreal"",
    "author": {
        "type": "card",
        "name": "Peter Rukavina",
        "email": "peter@rukavina.net (Peter Rukavina)"
    },
    "publication": "Peter Rukavina's Weblog",
    "summary": "I\u2019ve had Montreal, by Port Cities (recorded | live | remix) on rotation for weeks now.\n\nIt is a lovely song, with strong lyrics. But, more than that, I think it\u2019s a sort of universal song, inasmuch as the possibility of meeting someone at a house party in Montreal is within the atlas of possibilities for many Canadians: it just seems like the kind of thing we might all have in our past.\n\nI recall hearing a story, perhaps apocryphal, about the late Marc Gallant: he was living in an apartment in Montreal, and about to be evicted. So he invited everyone he knew to a house party and asked everyone to take something from the apartment home with them, to prevent the apartment\u2019s contents from being seized by the landlord.\n\nJust over a decade ago we saw Bruce Guthro in concert at Harmony House in Hunter River; Bruce brought his then-17-year-old son Dylan up on stage with him during that concert, and it was obvious that he\u2019d inherited the family musicality. Ten years on he\u2019s one of the trio that is Port Cities.",
    "published": "2019-05-29T13:27:06+00:00",
    "url": "https://ruk.ca/content/i-met-you-house-party-montreal",
    "uid": "https://ruk.ca/content/i-met-you-house-party-montreal",
    "post_type": "article",
    "date": "2019-05-29T13:27:06+00:00",
    "_id": 11686,
    "_is_read": true,
    "_yarns_microsub_post_read": ""
}

Example 2

(There is also a problem with author['name'] here, which is a Yarns problem and in-progress, so please disregard)

Screen Shot 2019-05-30 at 3 02 58 PM
{
    "type": "entry",
    "name": "Effect of context in swipe gesture-based continuous authentication on smartphones. (arXiv:1905.11780v1 [cs.HC] CROSS LISTED)",
    "author": {
        "type": "card",
        "name": "<a href="http://arxiv.org/find/cs/1/au:+Siirtola_P/0/1/0/all/0/1">Pekka Siirtola</a>, <a href="http://arxiv.org/find/cs/1/au:+Komulainen_J/0/1/0/all/0/1">Jukka Komulainen</a>, <a href="http://arxiv.org/find/cs/1/au:+Kellokumpu_V/0/1/0/all/0/1">Vili Kellokumpu</a>"
    },
    "publication": "cs.HC updates on arXiv.org",
    "summary": "This work investigates how context should be taken into account when\nperforming continuous authentication of a smartphone user based on touchscreen\nand accelerometer readings extracted from swipe gestures. The study is\nconducted on the publicly available HMOG dataset consisting of 100 study\nsubjects performing pre-defined reading and navigation tasks while sitting and\nwalking. It is shown that context-specific models are needed for different\nsmartphone usage and human activity scenarios to minimize authentication error.\nAlso, the experimental results suggests that utilization of phone movement\nimproves swipe gesture-based verification performance only when the user is\nmoving.",
    "url": "http://arxiv.org/abs/1905.11780",
    "uid": "http://arxiv.org/abs/1905.11780",
    "post_type": "article",
    "_id": 11722,
    "_is_read": true,
    "_yarns_microsub_post_read": ""
}

Counter-example

By contrast, the summary for this item is displayed.

Screen Shot 2019-05-30 at 2 51 36 PM
{
    "type": "entry",
    "author": {
        "type": "card",
        "name": "Peter Rukavina",
        "email": "peter@rukavina.net (Peter Rukavina)"
    },
    "publication": "Peter Rukavina's Weblog",
    "summary": "VBike, in Vermont, is a non-profit cycling advocacy group:\n\n\nVBike is a unique advocacy group dedicated to bringing super bike mobility to Vermont. We\u2019re talking a bike revolution. Electric-assist cargobikes for families & households, e-bikes and e-trikes for seniors & commuters \u2013 it\u2019s a game changer! Now we can get over the hills, ride our kids, smile, and not be confined to the automobile.\n\n\nIn my experience it\u2019s really hard to get information about anything other than \u201cregular\u201d bicycles here on PEI; while bike shops occasionally get in tricycles or three-wheel recumbent bicycles, they tend to be presented as a rare, unusual and expensive.\n\nIt seems clear that the future is going to demand that we use bicycles more, and for that to be accessible to all of us we\u2019re going to have to tackle a broader range of active transportation options.",
    "published": "2019-05-29T13:12:04+00:00",
    "url": "https://ruk.ca/content/vbike",
    "uid": "https://ruk.ca/content/vbike",
    "post_type": "note",
    "date": "2019-05-29T13:12:04+00:00",
    "_id": 11687,
    "_is_read": true,
    "_yarns_microsub_post_read": ""
}

Thoughts

It looks to me that summaries are only displayed if an item does not have a name property.

That's my understanding of https://github.com/aaronpk/Monocle/blob/master/views/timeline/name-and-summary.php#L25

My expectation is that, in the absence of a 'content', 'photo, 'video', or 'audio' property, summary should be displayed, unless it is a duplicate of the name property.