HelloZeroNet / HelloZeroNet/ZeroHello

Handle the case, when a post with no title is displayed in the feed.

未关闭
#96 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
73
派生
69
PR 合并指标
30 天内没有已合并 PR

描述

It is possible that the title field accidentaly isn't set or intentionaly left empty in the site DB. In that case, we have the following in the feed:

![untitled-1](https://user-images.githubusercontent.com/1287690/44947166-43de3000-ae33-11e8-80bd-2aa2232a3ef0.png)

It looks ugly, and we also cannot navigate directly to the post, since the title is the link.

The problem can be solved on the site's side, if the correct SQL query is used. For example:

```
@follow.addFeed("Posts", "
SELECT
post_id AS event_uri,
'post' AS type,
date_published AS date_added,
IFNULL(NULLIF(title, ''), '(untitled)') AS title,
body AS body,
'?Post:' || post_id AS url
FROM post", true)

```

In that example, `IFNULL(NULLIF(title, ''), '(untitled)')` replaces both NULL and the empty string with "(untitled)", so we have in the feed:

![untitled-2](https://user-images.githubusercontent.com/1287690/44947169-4e002e80-ae33-11e8-93cb-63cf7eef26d8.png)

But I believe it is better to handle that case on the ZeroHello side. It will be applied to any site, and it also makes possible to localize the '(untitled)' string in a uniform way.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by locating the ZeroHello feed rendering and how post titles become links. Check how missing and empty titles are displayed, then make both cases show a localized untitled label while keeping the post navigable; verify the resulting feed behavior for posts without titles.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。