cofacts

Month: 2021-10

2021-10-02

Hsu-Tzu Ting 09:28:49
@irene0503.ting has joined the channel
github2 15:04:59

<https://github.com/cofacts/rumors-line-bot/pull/292#issuecomment-932697705|Comment on #292 Redirect page>

*Pull Request Test Coverage Report for <https://coveralls.io/builds/43227581|Build 1297709786>* • *0* of *0* changed or added relevant lines in *0* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *87.333%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*

2021-10-03

cai 17:00:43
https://cofacts.tw/article/2sx0dkbklsewg 廣告
很多種變體,都是在詐騙文下回然後要人加「賴」
感謝回報!
要想一下怎麼處理囧
這很明顯可以用使用者條款直接刪,問題是之後如何輕鬆列出新的這類 spam

或許應該 spammer monitor 增加 reply request 的處理
https://docs.google.com/spreadsheets/d/1BBObfTO7bLWERQ3nq3S1iBs3xt2o2TgOxikXqixOdYI/edit
由於 reply request 不像 reply 還有留存內文,所以有個 spreadsheet 放刪除前的原文讓大家檢視也是不錯
詐騙、追回、加賴 這三個關鍵字吧?
也可以抓165的open data https://data.gov.tw/dataset/78432
不過我丟進去找過沒符合的
看來他有在手動反偵測,一直變……
撈了一番,目前找到的事:
• 3 個帳號、59 篇要刪掉的補充,幫 2 個 LINE ID 打廣告
https://docs.google.com/spreadsheets/d/1Ytd69YU6z7Fgra81_79XrsPwQYV1Clh0yp5OZlk5Psg/edit

2021-10-05

fewa110010 04:49:16
@fewa110010 has joined the channel
github2 09:52:45

<https://github.com/cofacts/rumors-site/issues/397#issuecomment-933993423|Comment on #397 Reorder categories so that marked and categories from similar articles can appear earlier>

``` Move categories that has been added to the front Then list out categories that is also marked in similar articles Then the rest of the categories. ``` how to find the `Then list out categories that is also marked in similar articles` ? <https://github.com/MrOrz|@MrOrz>

github2 10:52:38

<https://github.com/cofacts/rumors-site/issues/397#issuecomment-934014767|Comment on #397 Reorder categories so that marked and categories from similar articles can appear earlier>

Hi <https://github.com/kelvin2go|@kelvin2go> , Thanks for taking a look! It can be retrieved by modifying the <https://github.com/cofacts/rumors-site/blob/master/pages/article/%5Bid%5D.js#L131|current GraphQL query> to include categories in `similarArticles`. ``` query LoadArticlePage($id: String!) { GetArticle(id: $id) { # ... Other fields ... similarArticles: relatedArticles { edges { node { # ... Other fields for the similar article ... articleCategories { categoryId } } } } # ... Other fields ... } } ``` <https://user-images.githubusercontent.com/108608/135952661-4a730cf3-f499-4c50-bb6c-3fb4f953cab9.png|image>

Andy Zhao 11:25:44
請問有沒有辦法能聯繫上Line 訊息查證部門的人呢?我想與ta們進行學術研究上的合作,但是聯絡了很久都沒有回覆
真的假的不是直接聯繫訊息查證的部門耶 > <
嗯⋯主要是,實在問不到了⋯有點慌不擇路w🤦‍♂️🏻抱歉!
kidstarkenny 11:26:49
之前是怎麼聯繫的呢?
官網上的“聯絡我們”
請問您能聯繫上ta們嗎?
github2 22:44:33

<https://github.com/cofacts/rumors-site/pull/452|#452 397 add sorted category for articles>

it seem my prettier a bit different than the original project @_@

mrorz 23:42:51
Cofacts LINE bot 的 docker image 裡面沒辦法發 request 到 GA 收 event 的 API,導致 LINE bot 文章點閱 10/3 大幅下降,10/4 直接歸零。

交叉測試的結果是,production server 本身還可以送 event 進去,但 production server 裡的 rumors-line-bot docker image 不行。

請問單兵該如何處置 QQ
image.png

g0v.hackmd.io

20211006 會議記錄 - HackMD

kelvinho84 2021-10-05 23:54:12
can it ping www.google-analytics.com from prod server?
From prod server:
> docker@debian:~/rumors-deploy$ ping www.google-analytics.com
> PING www-google-analytics.l.google.com (142.251.42.142) 56(84) bytes of data.
> 64 bytes from … (略) …
> --- www-google-analytics.l.google.com ping statistics ---
> 8 packets transmitted, 8 received, 0% packet loss, time 7077ms
> rtt min/avg/max/mdev = 0.540/0.597/0.644/0.041 ms
From *LINE bot docker container* within prod server:
> PING www.google-analytics.com <tel:(203.208.50.65|(203.208.50.65>): 56 data bytes
> 64 bytes from … (略) …
> --- www.google-analytics.com ping statistics ---
> 16 packets transmitted, 4 packets received, 75% packet loss
> round-trip min/avg/max = 105.746/190.202/228.356 ms
docker container 裡面 ping 會掉 packet 好神奇
兩個 resolve 到的 IP 也不一樣
Sooo weird
host machine 可以正常 resolve 但 container 裡面 resolve 到 google CN ._.
機器本體是在 linode 日本機房
kelvinho84 2021-10-06 00:03:54
how about `traceroute www.google-analytics.com`
Host machine:
(`A`, `B`, `C` and `D` are under same subnet of my machine’s IP address)
```docker@debian:~/rumors-deploy$ traceroute www.google-analytics.com
traceroute to www.google-analytics.com (142.251.42.142), 30 hops max, 60 byte packets
1 A (A) 0.578 ms B (B) 0.709 ms 0.848 ms
2 if-11-1-5-0.gw2.shg1.jp.linode.com (C) 0.462 ms if-0-1-5-0.gw2.shg1.jp.linode.com (D) 0.485 ms 0.458 ms
3 72.14.196.114 (72.14.196.114) 2.102 ms 72.14.223.216 (72.14.223.216) 0.404 ms 0.408 ms
4 108.170.242.97 (108.170.242.97) 0.552 ms 0.595 ms 108.170.242.129 (108.170.242.129) 1.615 ms
5 108.170.236.127 (108.170.236.127) 0.542 ms 0.550 ms 0.561 ms
6 nrt12s45-in-f14.1e100.net (142.251.42.142) 0.583 ms 0.567 ms 0.532 ms```
---
Docker container
(DOCKER_GATEWAY: IP address used by docker (172.18.x.x); `E` and `F` are under same subnet of my machine’s IP address)
``` /srv/www # traceroute www.google-analytics.com
traceroute to www.google-analytics.com <tel:(203.208.50.65|(203.208.50.65>), 30 hops max, 46 byte packets
1 DOCKER_GATEWAY (DOCKER_GATEWAY) 0.007 ms 0.006 ms 0.004 ms
2 A (A) 0.560 ms 0.519 ms B (B) 0.806 ms
3 if-11-0-0-0.gw2.shg1.jp.linode.com (E) 0.471 ms if-11-1-5-0.gw1.shg1.jp.linode.com (F) 0.638 ms 0.314 ms
4 ae-9.a00.tokyjp05.jp.bb.gin.ntt.net (192.80.16.5) 0.833 ms 1.315 ms 1.074 ms
5 ae-22.r02.tokyjp05.jp.bb.gin.ntt.net (129.250.4.7) 1.594 ms 1.793 ms 1.209 ms
6 202.97.94.13 (202.97.94.13) 90.094 ms xe-0.chinanet.tokyjp05.jp.bb.gin.ntt.net <tel:(129.250.66.10|(129.250.66.10>) 204.861 ms ae-22.r02.tokyjp05.jp.bb.gin.ntt.net (129.250.4.7) 1.411 ms
7 * xe-3.chinanet.tokyjp05.jp.bb.gin.ntt.net <tel:(129.250.66.90|(129.250.66.90>) 161.073 ms *
8 202.97.74.2 (202.97.74.2) 80.426 ms 202.97.74.34 (202.97.74.34) 52.750 ms 202.97.91.25 (202.97.91.25) 56.915 ms
9 202.97.62.73 (202.97.62.73) 54.355 ms 202.97.94.141 (202.97.94.141) 205.894 ms *
10 202.97.19.53 (202.97.19.53) 90.569 ms 202.97.13.157 (202.97.13.157) 86.509 ms *
11 101.95.88.133 (101.95.88.133) 55.874 ms 61.152.24.105 (61.152.24.105) 87.906 ms 61.152.25.109 (61.152.25.109) 95.932 ms
12 * 101.95.95.162 (101.95.95.162) 112.589 ms 101.95.116.138 (101.95.116.138) 96.343 ms
13 * * 101.95.116.138 (101.95.116.138) 95.539 ms
14 * 203.208.62.221 (203.208.62.221) 96.958 ms 203.208.62.2 (203.208.62.2) 225.663 ms
15 203.208.62.55 <tel:(203.208.62.55|(203.208.62.55>) 220.407 ms 203.208.62.2 (203.208.62.2) 229.029 ms 203.208.62.16 <tel:(203.208.62.16|(203.208.62.16>) 224.079 ms
16 * 203.208.50.65 <tel:(203.208.50.65|(203.208.50.65>) 220.497 ms 203.208.62.55 <tel:(203.208.62.55|(203.208.62.55>) 238.744 ms```
這樣我們送的 hit 會進中國的伺服器耶也太噁
nslookup 更神奇,這下連 host machine 也是指向中國⋯⋯

Host machine
```$ nslookup www.google-analytics.com
Server: <some-ip-under-same-subnet>
Address: <some-ip-under-same-subnet>#53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com.
Name: www-google-analytics.l.google.com
Address: 203.208.50.65```
Docker container
```/srv/www # nslookup www.google-analytics.com
Server: 127.0.0.11
Address: 127.0.0.11:53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com
Name: www-google-analytics.l.google.com
Address: 203.208.50.65

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com```
感謝 @kelvinho84 通靈 m(_ _)m

鬼故事如下
我的 linode 的 network 是有開 network helper ( https://www.linode.com/docs/guides/network-helper/ ) 的。所以,Linode 會幫我管理 `/etc/resolv.conf`
所以我的 /etc/resolve.conf 長這樣
```# Generated by Linode Network Helper
# Thu Sep 16 18:08:49 2021 UTC
#
# This file is automatically generated on each boot with your Linode's
# current network configuration. If you need to modify this file, please
# first disable the 'Auto-configure Networking' setting within your Linode's
# configuration profile:
# - https://cloud.linode.com/linodes/2569620/advanced
#
# For more information on Network Helper:
# - https://www.linode.com/docs/platform/network-helper
#
# A backup of the previous config is at /etc/.resolv.conf.linode-last
# A backup of the original config is at /etc/.resolv.conf.linode-orig
#
domain members.linode.com
search members.linode.com
nameserver 第一台
nameserver 第二台
nameserver 第三台
options rotate```
而下面分別是我的 hostmachine 使用 8.8.8.8 以及這三台 linode name server resolve 出來的結果:
```host-machine:~# nslookup www.google-analytics.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com.
Name: www-google-analytics.l.google.com
Address: 172.217.160.78

host-machine:~# nslookup www.google-analytics.com 第一台
Server: 第一台
Address: 第一台#53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com.
Name: www-google-analytics.l.google.com
Address: 203.208.50.65

host-machine:~# nslookup www.google-analytics.com 第二台
Server: 第二台
Address: 第二台#53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com.
Name: www-google-analytics.l.google.com
Address: 142.251.42.142

host-machine:~# nslookup www.google-analytics.com 第三台
Server: 第三台
Address: 第三台#53

Non-authoritative answer:
www.google-analytics.com canonical name = www-google-analytics.l.google.com.
Name: www-google-analytics.l.google.com
Address: 216.58.197.238```
三台 name server 說的 `www.google-analytics.com` 位置都不同,但第一台 name server 回傳的 IP 「203.208.50.65」指向中國
然後又因為 docker container 會取用 host machine 的 /etc/resolv.conf ( https://docs.docker.com/config/containers/container-networking/#dns-services )
所以我的 line bot docker container somehow 就把 `www.google-analytics.com` 解析成了 googlecn 203.208.50.65
我把 host machine 上的 /etc/resolv.conf 的第一台 name server comment 掉之後重開 line bot 的 container

資料就能正常的送進 google analytics 了⋯⋯
kelvinho84 2021-10-06 08:49:57
DNS ! 那 docker image 是用一個 base 去build ?
😲 1

2021-10-06

github2 00:02:54

<https://github.com/cofacts/rumors-site/pull/452#issuecomment-934544622|Comment on #452 397 add sorted category for articles>

&gt; it seem my prettier a bit different than the original project @_@ <https://github.com/kelvin2go|@kelvin2go> You can run `npm run lint:fix`.

github2 00:31:55

<https://github.com/cofacts/rumors-site/pull/452#issuecomment-934570007|Comment on #452 397 add sorted category for articles>

<https://coveralls.io/builds/43285251|Coverage Status> Coverage remained the same at 75.261% when pulling *<https://github.com/cofacts/rumors-site/commit/c438ace8003e1cc84cd27b693eeefda8ca4a449f|c438ace> on kelvin2go:feature/397-reorder-caterogries* into *<https://github.com/cofacts/rumors-site/commit/7ed37f817d534ed683848a46763a248442310f99|7ed37f8> on cofacts:master*.

github2 01:54:27

Review on #452 397 add sorted category for articles

LGTM! Thanks for implementing this!

cai 11:02:29
會議記錄舉報按鈕那條,`舉報`建議改成`檢舉`或`回報濫用`
一般討論區沒必要用到舉報這詞XD
好的感謝感謝
github2 12:45:23

<https://github.com/cofacts/rumors-site/issues/397#issuecomment-935440507|Comment on #397 Reorder categories so that marked and categories from similar articles can appear in the front>

Closed via <https://github.com/cofacts/rumors-site/pull/452|#452> . Kudos to <https://github.com/kelvin2go|@kelvin2go> :raised_hands:

mrorz 12:53:10
今日會議紀錄
https://g0v.hackmd.io/@mrorz/cofacts-meeting-notes/%2FzlWWCpDTQ5iADHNw7Thpog

HackMD

Cofacts 會議記錄 - HackMD

# Cofacts 會議記錄 ## 2021 - [20211006 會議記錄](/zlWWCpDTQ5iADHNw7Thpog) - [20210929 會議記錄](/5VRwpbcJSlSP

mrorz 14:18:48
中午開放報名的大松,已經超過一半滿囉
名額有限要搶要快!

:schmusekatze::point_right: <https://g0v-jothon.kktix.cc/events/g0v-hackath46n>

📈 2
Carmen 15:36:21
想請問cofacts的各位,大松當天現場會有人去提案嗎?還是說會採線上提案方式?
我會去ㄛ
謝謝!那發表內容我就知道,是上次比鄰的回覆那樣是吧?
謝謝你!我去把它簡單轉譯成日文,要跟節目組開會。
謝謝回覆。
謝謝~~~~
github2 17:41:32

<https://github.com/cofacts/rumors-site/pull/453|#453 add github like contribution graph css and ceil for 1,2 report count>

<https://github.com/cofacts/rumors-site/issues/413|#413> • math.ceil for 1,2 • add github contribution graph like css <https://user-images.githubusercontent.com/2888757/136179050-87baa028-a0ca-44ae-8429-7076f1e578a3.gif|screen-capture (1)>

:white_check_mark: No checks have passed

2021-10-07

mrorz 12:00:20
我發現 Wikipedia 的封禁(block)會告知對方自己被封禁耶
https://zh.wikipedia.org/wiki/Wikipedia:%E5%B0%81%E7%A6%81%E6%96%B9%E9%92%88

Wikipedia 對外送茶 (?) 這類廣告行為的做法,似乎不用怕對方說會換帳號或 IP 之類的,跟昨天 Cofacts 會議中討論的做法(不讓廣告業者發覺自己被封鎖,但隱藏所有他的廣告文)相反。

Wikipedia:封禁方针

封禁,又称封锁或查封,是管理员阻止用户参与维基百科编辑的手段。封禁的目的只有一個,就是防止维基百科遭到持续或严重破坏,而绝非惩罚用户。 用户可以在当前的破坏页面或者本文提及的其他页面中提议封禁,提议的同时亦应提供充分的证据,但管理员有权拒绝执行被提议的封禁,并可以进行独立的调查。如果您认为某一个封禁不合理,请在使用者討論頁使用{{Unblock}}或向管理员发電子郵件讨论。

github2 14:49:30

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-937504328|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

``` adaptive max contribution max(10, max(user_contribution)) 作為 contribution graph 的 max scale ``` for this, should it changes max scale to 10 ? <https://github.com/cofacts/rumors-site/pull/453/files#diff-b170cff4fb01eac4d00fe240d828301e6e8900a7ae3443ad833eeff2a6d64d8fR13|https://github.com/cofacts/rumors-site/pull/453/files#diff-b170cff4fb01eac4d00fe240d828301e6e8900a7ae3443ad833eeff2a6d64d8fR13> and for test part should i update the story snapshot after implement?

2021-10-10

github2 13:35:05

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-939410341|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

Sorry for the late reply, and thanks for taking this issue! • Current coloring of attribution is fixed at 5 contributions per level (`SCALING_FACTOR`). Therefore, daily contribution must exceed 23 (`23 / SCALING_FACTOR = 4.6 ~= 5`) to be painted to deepest color. • The _adaptive max contribution proposal_ wants that max scale to adapt to each user. For example, if the max contribution count of the user is 16 for the past 365 days, we should color the contribution count 1 ~ 4 with light color, 5 ~ 8 with deeper color, 9 ~ 12 with 2nd deeper color, and 13 ~ 16 with deepest color. • However, if the max contribution count of the user for the past 365 days is lower than 10, it would be a bit unfair for other contributors if we also paint those contribution as deepest color. Therefore, in the proposal we added a max-contribution lower-bound: if the max contribution count of the user for the past 365 days is lower than 10, we will use 10 when calculating the color scale. If we put it in code, • `MAX_SCALE` remains 4, as available `colorCofactsN` still ranges from `colorCofacts0` to `colorCofacts4`. • `SCALING_FACTOR` (number of contributions needed to go to the deeper color) should no longer be a constant across different users. If max contribution in `data` is below 10, the scaling factor is `10/MAX_SCALE = 2.5`; otherwise, it is `max contribution / MAX_SCALE`. • The logic of `scaleColor` is `Math.max(Math.min(Math.ceil(count / varingScalingFactor), MAX_SCALE), 0)`. The inner-most `Math.ceil` is identical to your current PR :+1: And yes, the storyshot should be updated and attached to the PR, so that we can know there are DOM changes in the PR :eyes:

Tony Duan 14:29:33
@tony84727 has left the channel

2021-10-11

聞英佐 01:11:50
@ahgigi95 has joined the channel
mrorz 12:38:48
我在實作 block user 的時候,覺得如果要實作「被封鎖的使用者登入的話會看得到自己的東西」這件事情,那就必須解決現在 SSR 會吃不到使用者 login cookie 的問題。

因此,我想要把網站的所有 API request 從直接造訪 api.cofacts.tw 改成一個 `/api` endpoint,他背後會 proxy_pass 到 API server。這樣無論使用者是到 cofacts.org 還是 cofacts.tw 還是 cofacts.g0v.tw,打 API 的時候,SSR 與 API 通通都是同一個網域,既沒有 CORS 問題,也沒有 SameSite cookie 問題。

這個方案之前有提過:https://github.com/cofacts/rumors-api/issues/186#:~:text=Method%202%3A%20use%20same-site%20APIs%20whenever%20possible
之前也有看過其他網站(忘記哪個了⋯⋯)這樣做,我在工作上也在用這個同網域 api proxy 的技巧。

這個方案也可以解決
• iOS 12 login issue https://github.com/cofacts/rumors-api/issues/259
• 網站不需要再分第一次 SSR 的 request 與第二次登入 cookie 的 request,第一個 SSR request 就吃得到 login cookie 所以可以直接 render logged in state 下看得到的東西
但有一個缺點:
• github 登入未來只能在一個網域生效。由於 github oauth app 只能設定一個 valid redirect URL,因此如果我們設定為 cofacts.tw/api/callback/github ,那麼 cofacts.org, cofacts.g0v.twold.cofacts.tw 就通通不能登入 github ㄌ。
lucien 23:43:20
終於要走proxy了讚讚
lucien 23:43:39
我過去所有專案都是走proxy

2021-10-12

mrorz 02:37:17
結果沒能在 next.js 上架好 proxy (掩面
屍體:
https://github.com/cofacts/rumors-site/tree/api-proxy

或許不要透過 nextjs api route 而是直接把 proxy 放在 server.js 比較直接些。
另外,現在版本的 next-apollo 也太舊,沒辦法拿到 browser 送來的 cookie 轉送給 API。要改進這個的話乾脆直接升級 next.js,改寫邏輯丟掉 next-apollo 比較好。

因為上面這些很麻煩,最近應該不會碰 proxy 了,後來覺得 block user 不一定需要讓 SSR 吃到 login cookie 送往 APIP,只要能吃到 rumors-site 自己設的 cookie,就能決定是不是要 SSR~
Kevin Chen 10:07:16
@jwsh09910062 has joined the channel
github2 13:26:31

<https://github.com/cofacts/rumors-line-bot/issues/294|#294 TypeError: Cannot destructure property 'articleReplies' of 'e' as it is null.>

View details in Rollbar: <https://rollbar.com/mrorz/rumors-line-bot/items/539/|https://rollbar.com/mrorz/rumors-line-bot/items/539/> ``` TypeError: Cannot destructure property 'articleReplies' of 'e' as it is null. File "<https://line-bot.cofacts.tw/liff/index.f45801dc3131a2f90145.js>", line 1, in [anonymous] File "<https://line-bot.cofacts.tw/liff/index.f45801dc3131a2f90145.js>", line 1, in wr File "<https://line-bot.cofacts.tw/liff/index.f45801dc3131a2f90145.js>", line 1, in i ``` Can be reproduced: <https://user-images.githubusercontent.com/108608/136896754-60e0a7b6-ba03-440f-8f9f-0185bb7ce81e.png|image> Root cause: the `articleId` is malformed and thus `GetArticle` field returns null. Proposed fix: gracefully fallback to an error text

github2 14:52:01

<https://github.com/cofacts/rumors-line-bot/pull/295#issuecomment-940717091|Comment on #295 Redirect LIFF &amp; article LIFF fixes>

*Pull Request Test Coverage Report for <https://coveralls.io/builds/43431587|Build 1331940430>* • *0* of *0* changed or added relevant lines in *0* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *87.333%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*

2021-10-13

2021-10-14

pengs05 09:30:49
@pengs05 has joined the channel

2021-10-15

cai 00:38:16
https://cofacts.tw/article/102wtths7w9ft
https://cofacts.tw/article/2edbicuinv0fi
話說這種明明知道是民間自己開發的非官方工具要怎麼寫回答 🤔
看了下原始碼,只是單純比對數字,很多規則都沒考慮到
看了下原始碼,只是單純比對數字,很多規則都沒考慮到
哎呀沒有看到 @iacmai 留言 QQ
當天中午回了一份
那時候因為看到短時間回報數超高就丟這裡問了
我有看到回答XD
後來我試著用一種「鼓勵民間自主開發但不要幫他背書」的語氣,列出事實(以及以上事實的時間),也提醒大家 open source solution 是 no warrenty 的這樣~
github2 15:27:55

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944064478|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

<https://github.com/MrOrz|@MrOrz> I updated varingScalingFactor and the snapshot. Can you check it ? but snapshot test seem fail on other component. ``` modified: components/AppLayout/AppHeader.js modified: components/AppLayout/AppSidebar.js modified: components/AppLayout/__snapshots__/UpgradeDialog.stories.storyshot modified: components/ArticleCategories/CategoryOption.js modified: components/ArticleReplyFeedbackControl/__snapshots__/ArticleReplyFeedbackControl.stories.storyshot modified: components/Infos/__snapshots__/Infos.stories.storyshot modified: components/ListPageControls/__snapshots__/BaseSortInput.stories.storyshot modified: components/ListPageControls/__snapshots__/BaseTimeRange.stories.storyshot modified: components/ListPageControls/__snapshots__/Filters.stories.storyshot modified: components/ListPageControls/__snapshots__/LoadMore.stories.storyshot modified: components/ProfilePage/UserPageHeader.js modified: components/ReportPage/__snapshots__/ActionButton.stories.storyshot modified: components/__snapshots__/Hyperlinks.stories.storyshot modified: components/__snapshots__/TrendPlot.stories.storyshot modified: components/__snapshots__/icons.stories.storyshot ```

2021-10-16

github2 14:27:19

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944866607|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

<https://github.com/kelvin2go|@kelvin2go> It seems that your local material-ui version is different from this project. You can try the command writing in <https://github.com/cofacts/rumors-site#storybook|README.md> : ``` # install the same npm package as this project npm install # run test and update snapshot npm test -- -u ```

github2 14:51:05

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944869043|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

&gt; <https://github.com/kelvin2go|@kelvin2go> It seems that your local material-ui version is different from this project. &gt; &gt; You can try the command writing in <https://github.com/cofacts/rumors-site#storybook|README.md> : &gt; &gt; ``` &gt; # install the same npm package as this project &gt; npm install &gt; &gt; # run test and update snapshot &gt; npm test -- -u &gt; &gt; ``` hi <https://github.com/nonumpa|@nonumpa>, i only changed components/ContributionChart.js so i update only components/*snapshots*/ContributionChart.stories.storyshot or when i run `test -- -u` it changed other files as below. shoud i updated it to branch as well? ``` modified: components/AppLayout/__snapshots__/UpgradeDialog.stories.storyshot modified: components/ArticleReplyFeedbackControl/__snapshots__/ArticleReplyFeedbackControl.stories.storyshot modified: components/Infos/__snapshots__/Infos.stories.storyshot modified: components/ListPageControls/__snapshots__/BaseSortInput.stories.storyshot modified: components/ListPageControls/__snapshots__/BaseTimeRange.stories.storyshot modified: components/ListPageControls/__snapshots__/Filters.stories.storyshot modified: components/ListPageControls/__snapshots__/LoadMore.stories.storyshot modified: components/ReportPage/__snapshots__/ActionButton.stories.storyshot modified: components/__snapshots__/Hyperlinks.stories.storyshot modified: components/__snapshots__/TrendPlot.stories.storyshot modified: components/__snapshots__/icons.stories.storyshot ```

github2 15:26:42

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944873152|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

It's abnormal, and I guess other .storyshot files also change `className="makeStyles-tooltipText-311"` to `className="makeStyles-tooltipText-74"`. Maybe you can google the keyword "npm local vs global package" to solve this problem. * * * Explanation of why I guess your local material-ui version is different from this project and why it should not have `className="makeStyles-tooltipText-*"` change : First, we take a look at the .storyshot change <https://user-images.githubusercontent.com/6376572/137577194-cab342b0-5ae3-476c-aae8-a34754e39afa.png|snapshot> And then look what <https://github.com/cofacts/rumors-site/runs/3903371438|CI test> result says &gt; line 35 and 36 means &gt; It should be `aria-hidden="true"` not `aria-hidden={true}` &gt; line 48 and 49 means &gt; It should be `className="makeStyles-tooltipText-311"` not `className="makeStyles-tooltipText-74"` That means only `className="makeStyles-colorCofacts*"` is the right change. This makes sense because you only change the function `scaleColor` which only affects `colorCofacts*`.

github2 21:58:02

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944919232|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

hi <https://github.com/MrOrz|@MrOrz> , after test with <https://github.com/nonumpa|@nonumpa> look like "@material-ui/core": "^4.9.7", 4.9.9 can pass the test. not sure, which version is CI using @@'

github2 22:33:17

<https://github.com/cofacts/rumors-site/pull/453#issuecomment-944924303|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

<https://coveralls.io/builds/43552123|Coverage Status> Coverage increased (+0.03%) to 75.295% when pulling *<https://github.com/cofacts/rumors-site/commit/c650642af23d91000f74a9beb89ae511c711990d|c650642> on kelvin2go:feature/413-contribution-graph-enhancements* into *<https://github.com/cofacts/rumors-site/commit/8c26bbb82ca329429f6be3b2aa4163e4327b4dbd|8c26bbb> on cofacts:master*.

github2 23:10:53

<https://github.com/cofacts/rumors-site/pull/453#discussion_r730274510|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

`varingScalingFactor` should vary according to _max contribution count_; `count` is the contribution count of the current cell and should not be used when calculating `varingScalingFactor`. The current logic will make any contribution count &gt;= 10 colored in the deepest color (because in this case, `count / varingScalingFactor` = `count / (count / MAX_SCALE)` = `MAX_SCALE`); however, what we want in the <https://github.com/cofacts/rumors-site/pull/453#issuecomment-939410341|comment> is that the `varingScalingFactor` scales according to _max contribution count_ instead of `count`. We will need to calculate the max contribution count in a place that is accessible to such data (such as in `ContributionChart`. There is already a `total` const being calculated there, max contribution count should be calculated in a similar fashion) and passed to `scaleColor` as a new argument.

github2 23:10:54

Review on #453 add github like contribution graph css and ceil for 1,2 report count

Thanks for trying to fix this issue! An implementation detail of color scale is attached below.

2021-10-18

2021-10-20

github2 12:50:08

<https://github.com/cofacts/rumors-site/pull/453#discussion_r732412011|Comment on #453 add github like contribution graph css and ceil for 1,2 report count>

Should be Suggested change Current logic will cause `count` &lt; 10 to have deeper color than `count` &gt; 10. <https://user-images.githubusercontent.com/64118746/138030035-33831f87-3124-4c54-b1c3-75ece6e718e1.gif|8-10>

github2 12:58:10

Review on #453 add github like contribution graph css and ceil for 1,2 report count

Now the new color system and mobile style is working as expected. Thank you for the fix!

mrorz