#cofacts

2021-02-01
rockhung 10:35:47
查證屬實之後再 ban 掉 😄
Kay 10:39:33
第一時間的假消息,確實只能讓子彈飛,除非是AI寫的,而且被抓到特定PATTERN,不然人寫的,基本上無從判別
github 13:51:50
Refer to Readme here: <https://github.com/cofacts/rumors-ai-bert/tree/master/GPU_host|https://github.com/cofacts/rumors-ai-bert/tree/master/GPU_host>
2021-02-02
github 13:45:31
• Add `LEGAL.md` • Update README to explain the difference between `LEGAL.md` and `LICENSE` • Upgrade copyright holder for MIT license
github 14:29:06
<https://coveralls.io/builds/36780833|Coverage Status> Coverage decreased (-0.05%) to 86.038% when pulling *<https://github.com/cofacts/rumors-api/commit/b41e0993e7645aa1372fc171b009801f09208c4e|b41e099> on legal* into *<https://github.com/cofacts/rumors-api/commit/c2ff8f2c8f7221bf431fb760438d09b01a8e6608|c2ff8f2> on master*.
markdown 檔居然也算在 coverage 的分母嗎
傻眼
Coverage status 表示 `src/util/pseudonymDict.js` 下降到 ˙ 75%
應該是 random 造成的吧?
mrorz 14:32:34
markdown 檔居然也算在 coverage 的分母嗎
傻眼
nonumpa 15:55:04
Coverage status 表示 `src/util/pseudonymDict.js` 下降到 ˙ 75%
應該是 random 造成的吧?
2021-02-03
nissen 10:57:12
@handeltonido has joined the channel
mrorz 13:19:59
@gary0626 的 code 今天上 production 囉
感謝感謝
https://github.com/cofacts/rumors-site/releases/tag/release%2F20210203
謝謝🥺~我這個月比較忙,三月後繼續認領
mrorz 13:20:08
release
mrorz 13:58:06
下週三 2/10 小年夜
開會暫停一次唷~
2021-02-04
Kay 10:01:44
好奇問一下coverage要多少才能過?
Coverall 是要求「coverage 不能 drop」
但我有時候也會無視它 XD
mrorz 11:08:36
Coverall 是要求「coverage 不能 drop」
但我有時候也會無視它 XD
mrorz 11:09:41
Replied to a thread: 2021-02-03 13:58:06
下週三 2/10 小年夜
開會暫停一次唷~
2021-02-05
mrorz 01:56:00
是說 @acerxp511@lucien 有比較過 `bull` 與 `bullmq` (下一代 `bull`) 嗎
我看那段介紹好像沒什麼功能上的差別,就跳過了
lucien 01:59:43
bullmq 是什麼新玩意
mrorz 03:08:32
Premium Queue package for handling distributed jobs and messages in NodeJS.
mrorz 03:08:50
LINE ENGINEERING
於 1/18 釋出了一篇新聞 Reminder: On March 1, 2021, "Replace (Backward compatibility mode)" will be removed from the permanent link redirection settings for LIFF app and LINE MINI App,在這個新聞中提到將會在 3/1 移除 LIFF 的 Replace 模式:
  • 1
nonumpa 09:00:13
我看那段介紹好像沒什麼功能上的差別,就跳過了
2021-02-06
github 03:33:53
I'm still reviewing, just send out 2 comments here
github 03:33:53
Please add a paragraph regarding custom dimension setup in GA in the README
github 03:33:53
We can directly Suggested change
2021-02-08
Ula 09:42:16
謝謝🥺~我這個月比較忙,三月後繼續認領
2021-02-09
Deniz Bozyigit 00:49:38
@deniz195 has joined the channel
2021-02-11
github 02:02:20
• Add `LEGAL.md` • Update README to explain the difference between `LEGAL.md` and `LICENSE` • Upgrade copyright holder for MIT license
github 12:57:55
Opendata download keep hitting LFS free quotas, thus remove and relocate files to other places
github 12:58:53
We are moving away from git-lfs now, see <https://github.com/cofacts/opendata/pull/20|#20>
github 14:42:50
• Add LEGAL.md • Update paragraphs regarding terms to latest description
github 17:54:08
• Add `LEGAL.md` • Update README to explain the difference between `LEGAL.md` and `LICENSE` • Upgrade copyright holder for MIT license
github 18:11:43
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37053133|Build 1259>* • *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 *86.42%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 21:01:10
UI: <https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=2011%3A0|https://www.figma.com/file/zpD45j8nqDB2XfA6m2QskO/Cofacts-website?node-id=2011%3A0> Spec: <https://g0v.hackmd.io/sB_zayWjTo-W0R7xe_U34w#%E5%88%86%E9%A0%85%E8%A7%A3%E8%AA%AA|https://g0v.hackmd.io/sB_zayWjTo-W0R7xe_U34w#%E5%88%86%E9%A0%85%E8%A7%A3%E8%AA%AA>
mrorz 21:28:42
是說 bull 的 queue 的 payload data 真的是存在記憶體裡嗎 @@
我們直接把整個 req 塞進 queue payload 是沒問題的嗎 @@
https://github.com/cofacts/rumors-line-bot/pull/238/files#diff-c48cdd9eccbe1f123af78560acde5fe1e824ef197cda67e89b91b19ec6e51f90R344
hmm.. 我剛剛查了一下他們是存在 redis
我把 req 拿掉好了,其實 function 裡面也沒用到
nonumpa 21:52:43
hmm.. 我剛剛查了一下他們是存在 redis
nonumpa 21:57:16
我把 req 拿掉好了,其實 function 裡面也沒用到
2021-02-12
github 00:46:17
Just curious: Does eslint-plugin-prettier recognize this file?
github 23:43:52
Thanks for the implementation! I have added some comments and some hints on GA. Happy Lunar New Year!
github 23:43:52
nit: move the definition of `validCategories` outside of `processText()` and change name to `VALID_CATEGORIES` to indicate that it is a constant
github 23:43:52
TODO: remove `req` as discussed in slack.
github 23:43:52
Actually replyCount is identical to number of normal article replies. In `processText()`, we are only querying article replies in the GraphQL, thus `articleReplies.length` is actually identical to `replyCount` and `replyCount` is not needed if we are passing the whole `articleReplies` array in.
github 23:43:52
nit: can move `introKeywords` to oustide of `processText()` and use the name `INTRO_KEYWORDS` to indicate that it's a const
github 23:43:52
I think we should send GA event `Article` / `Selected` / `&lt;selected article id&gt;` if an "identical doc" is found, even if the message is not in selected categories or has no replies. This way we can detect each message's popularity better.
github 23:43:53
If there is a valid `articleReply`, we can send GA event `Reply` / `Selected` / `&lt;selected reply id&gt;` as well.
github 23:43:53
Please add a paragraph regarding custom dimension setup in GA in the README. Actually, since the number of group member is meant to be added together rather than use as a category, we should use <https://support.google.com/analytics/answer/2709828?hl=en|custom metrics> instead of custom dimensions.
github 23:43:53
I am confused by the 4 jobs and the changing `processGroupEvent` mock. May I know what would happen to the 4 jobs here?
github 23:43:53
It seems that it should happen in real case as well. When a job is added to `expiredJobQueue` in `processJob`, it must have an expired timestamp. By the time the job is executed by `expiredJobQueue`, `processGroupEvent` will be invoked, and `isEventExpired()` inside will still throw a `TimeoutError`.
github 23:43:53
Let's use logical or assignment instead of bitwise or assignment Suggested change
github 23:43:53
Extra `event` given to `getValidArticleReply` and most of `getValidArticleReply ()` below
github 23:43:53
We can directly use `categoryId` to save 1 category look-up query. Suggested change Note: we should change `category.id` to `categoryId` below if we want to take this change.
github 23:43:53
nit: give this test case a different name so that its snapshot is easier to find
2021-02-13
github 00:20:11
I am seeing that some image files are &gt; 50KB. I suggest using <https://imageoptim.com/mac|ImageOptim> or pngquant (uses the same core as TinyPNG, but is easier to use since they run on local machine) and perform lossy compression on all committed image files first.
github 19:26:04
This PR will make chatbot return list of replies when a URL to article page is sent to Cofacts chatbot. This should make 3rd party chatbot integration easier. cc/ <https://github.com/CarolHsu|@CarolHsu> *Screenshots* (`SITE_URL` setting on my local machine is `<https://cofacts.hacktabl.org>`, thus it's triggered by that. On production it should be `<https://cofacts.org>`.) <https://user-images.githubusercontent.com/108608/107848774-1e8de280-6e31-11eb-98a6-779134fdbf25.png|image>
github 19:31:04
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37108703|Build 1262>* • *4* of *4* *(100.0%)* changed or added relevant lines in *1* file are covered. • No unchanged relevant lines lost coverage. • Overall coverage increased (+*0.04%*) to *86.459%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 23:16:35
Since we do not need to trigger re-render when memorizing `timeoutId`, we can just use a ref to store `timeoutId` instead.
github 23:16:35
Please add <https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag|`passHref`> so that `Button` can be set a `href` prop, turning it to be an tag. This enables users to cmd-click / long-click open new wondow for the button. Suggested change
github 23:16:35
Suggest • Remove context (`c`) because we probably want to use the same translation if it's used elsewhere • Capitalize and make it look like a short sentence for better SEO Suggested change
github 23:16:35
Thanks for the PR. Happy new year! I have added some suggestions regarding react-router `&lt;Link&gt;` and my thoughts on `Slider` props design. Review progress: <https://user-images.githubusercontent.com/108608/107853539-a7b51180-6e51-11eb-81fd-e4c362e7531b.png|image>
github 23:16:35
Suggest • Remove context (`c`) because we probably want to use the same translation if it's used elsewhere • Capitalize to make it look like a short sentence for better SEO Suggested change
github 23:16:35
As described in <https://reactjs.org/docs/hooks-reference.html#useimperativehandle|ReactJS doc>, imperative code using ref (such as calling `slideTo` outside of `Slider`) should be avoided. We can pick one of the following instead: 1. Make `&lt;Slider&gt;` become an uncontrolled component; Move active indicator inside `&lt;Slider&gt;` component. Anything outside `&lt;Slider&gt;` cannot determine which page to set active. 2. Make `activeIndex` be an optional prop instead. • If `activeIndex` is given, `&lt;Slider&gt;` acts as a controlled component, simply reflecting `activeIndex` and use `onSlideChange` to notify active index change from within the component. • If `activeIndex` is not given, `&lt;Slider&gt;` acts as an uncontrolled component, maintaining its own `activeIndex` as a state. I suggest 2, because it gives better flexibility and we actually only have 1 place that needs to be controlled component (when indicator exists).
github 23:16:35
Same as above. It's <https://reactjs.org/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies|not safe> to omit functions from dep arrays. As for `timeoutId`, it should really be a ref instead of a state. If it were a ref, we don't need to list it in dependency array either, as `ref.current` always points to the latest value, and we will never get a stale ref value coming from some unknown closure. Suggested change
github 23:16:35
I suggest we just add `initIndex` and `slideTo` to deps array and remove this hook. Adding these two dep should not break the whole thing, while disabling this may cause problem when we add code to this `useEffect` in the future. Suggested change
github 23:21:39
Please consider using existing `&lt;Ribbon&gt;` instead of SVG. You can modify `&lt;Ribbon&gt;` to support blue background.
2021-02-14
github 01:23:55
有點難描述,我用中文好了 哈哈 這裡要測試 expireQueue 執行時,如果有新的 event 進來,expireQueue 要被暫停,並且執行完 jobQueue 後再繼續,利用監聽 expiredJobQueue 的 active event 加上 `concurrency` 設成 `1`,我們可以確保在 expiredJobQueue 執行期間,插入一個沒過期的 job。 1. 因為這裡把 `GroupHandler` 的 `concurrency` 設成 `1`,所以四個 expiredJob 會在 jobQueue 的 process function <https://github.com/cofacts/rumors-line-bot/pull/238/files/a04a06cccbb584af1d0e3e946e6e8c1b4ff012db#diff-eea0db6bb6c18528afc0978099a6d13f4529cf3f945e332e7af1749204c39d92R38|`processJob`> 一個一個(不保證順序)處理並加進 expiredJobQueue,這裡並不會執行到 `processJob` 裡面的 `processGroupEvent`。 2. 當所有(四個) jobQueue 的 job 被執行完之後(`onDrained`),expiredJobQueue 會開始(resume)執行。 3. 當第一個 expired job 開始執行時,會同時送出一個 expiredJobQueue 的 job active event。 4. 在收到 expired job active event 的時候加入一個沒過期的 job (到 jobQueue),並且為了讓它成功,把 `processGroupEvent` 改成 resolve,在 jobQueue on('completed' 改回來。 其實這邊我期望是可以 mockImplementationOnce(expired x 4 + success x 1),但是 `processGroupEvent` 被執行的順序可能是 • testExpiredId1 -&gt; (expiredJobQueue active event) -&gt; successJobId -&gt; testExpiredId2 -&gt; ... • testExpiredId1 -&gt; (expiredJobQueue active event) testExpiredId2 (幾乎同時)-&gt; successJobId -&gt; ... 因為我們不能保證 active event 收到的時機,不知道 success mock 要放在第幾個順位才能正確讓 successJobId 是 resolve 的,所以就在收到第一個 expiredJobQueue (job) 的 active event 時把它改成 resolve,在它完成時再改回 reject,這樣就會造成一個問題是:把 `processGroupEvent` 改成 resolve 時剛好 testExpiredId2 開始了 expiredJobQueue 還沒 pause,所以 testExpiredId2 的結果就是 complete 的(理論上 expiredJobQueue 的 job 要在 `processGroupEvent` 裡面全被 reject) 這裡只 expect jobQueue 的 success/fail count,因為 expiredJobQueue 的結果可能每次都不一樣
github 23:30:04
感謝感謝 我在想如果「這裡要測試 expireQueue 執行時,如果有新的 event 進來,expireQueue 要被暫停,並且執行完 jobQueue 後再繼續」 若把下面這兩塊拆成兩個分開的 test case,會不會比較簡單 1. `expireQueue` 執行時,如果有新的 event 進來,`expireQueue` 要被暫停 --&gt; 先往 `expireQueue` 塞東西,再 `gh.addJob`,然後 expect `expireQueue` 的 status 2. 執行完 `jobQueue` 後再繼續 --&gt; 先準備一個暫停的 expireQueue,然後 `gh.addJob`,然後在該 job 完成之後 expect expireQueue 的 status 是否不是 pause
2021-02-15
github 22:17:55
2nd batch of review comments. All previous commits have been reviewed. Regarding the two new pages, I come up with new URLs that is more commonly used in other websites: • `/what-is-cofacts` --&gt; `/about` • `/how-to-use` --&gt; `/tutorial`
github 22:17:55
Since the height of the content wrapper is fixed, it's possible that the content needs scrolling. In this case, I think we should not hide the scrollbars. I suggest we style the scrollbar so that the track is transparent, but make the scrollbar thumb still visible.
github 22:17:55
I think we can keep it simple, just use `fileMock` for the 4 file formats
github 22:17:55
Please use <https://material-ui.com/components/tabs/#nav-tabs|Material-UI nav tabs> + &lt;<https://nextjs.org/docs/api-reference/next/link%7Cnext.js> `&lt;Link&gt;`&gt; (may need to turn on `passHref` to work properly) for each tab element so that • web crawlers can recognize that this is a link and follow through • users can cmd-click / long-press to open tab in new browser tab • clicking on tab can have ripple effect
github 22:17:56
Suggest using `&lt;a&gt;` here so that the user will be able to cmd-click / long-press to open in new browser tabs, and it will also work for web crawlers to successfully follow the links
github 22:17:56
The color have a name "Blue 2" on figma: <https://user-images.githubusercontent.com/108608/107931593-722a3880-6fb7-11eb-8689-a8d275bdb26a.png|image> It's available via `theme.palette.common`. Suggested change
github 22:17:56
Nit: we can use `nav` HTML tag so that web crawlers _may_ recognized that it contains navigational links :stuck_out_tongue:
2021-02-16
github 15:44:26
Since we support third-party chatbots sending URLs to trigger `choosingArticle`, we should better handle exceptions, especially for the case when article id is not correct (user typed in extra message before sending it to Cofacts) <https://user-images.githubusercontent.com/108608/108032616-b841d380-706d-11eb-82a5-56b4c0ca686d.png|image>
github 15:47:42
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37159288|Build 1267>* • *2* of *2* *(100.0%)* changed or added relevant lines in *1* file are covered. • No unchanged relevant lines lost coverage. • Overall coverage increased (+*0.04%*) to *86.498%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 18:53:31
to fix known issue in <https://github.com/cofacts/rumors-site/pull/387|#387>
2021-02-17
github 01:29:37
• Remove `checkConsent` and its corresponding env var `LICENSE_URL` • Will no longer apply • index contains link to `LEGAL.md` • index contains instructions on how to query API <https://user-images.githubusercontent.com/108608/108099286-5e69f980-70bf-11eb-9750-79b1d26d08ea.png|image>
github 02:00:14
<https://coveralls.io/builds/37176645|Coverage Status> Coverage increased (+0.5%) to 86.578% when pulling *<https://github.com/cofacts/rumors-api/commit/81f8a19bffe78bfd9a2d57d508745cc56230fcd5|81f8a19> on display-legal* into *<https://github.com/cofacts/rumors-api/commit/0d6990c171402f8da7857aa79097da68ad45c458|0d6990c> on master*.
mrorz 11:43:58
小小的 chatbot error handling 求 review
https://github.com/cofacts/rumors-line-bot/pull/242
Since we support third-party chatbots sending URLs to trigger `choosingArticle`, we should better handle exceptions, especially for the case when article id is not correct (user typed in extra message before sending it to Cofacts) <https://user-images.githubusercontent.com/108608/108032616-b841d380-706d-11eb-82a5-56b4c0ca686d.png|image>
github 13:22:51
Discovered at <https://g0v.hackmd.io/@mrorz/cofacts-meeting-notes/%2FJUVhhxSmSx62O5SUVuJ1rw|20210120> release check. Ex: <https://dev.cofacts.org/article/37rwpsmfuqeiz|https://dev.cofacts.org/article/37rwpsmfuqeiz> <https://user-images.githubusercontent.com/108608/108160020-344a2300-7123-11eb-9d5f-3f9fcfa22e89.png|image>
github 14:13:42
Thanks for the update! I have resolved comments that have been implemented. What's left are: • `tutorial.js` image tab (`tabContainer`) should use `&lt;a&gt;`; consider using semantic tag `nav` for `tabContainer` • use `fileMock` and remove `styleMock`
github 15:39:36
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37194303|Build 1270>* • *116* of *132* *(87.88%)* changed or added relevant lines in *8* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage increased (+*0.3%*) to *86.709%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 15:55:29
Sorry, the comment might come from copy and paste and I forgot to remove it.
github 18:37:53
Seems that most issues are resolved. Things left are 1. documentation regarding the custom dimensions; and if we should use custom metric instead of custom dimension for user count in chat groups 2. excessive comment 3. simplify test case I think we can discuss on 1 because setting custom metric / dimension cannot be undone in the future. Documentations, comments &amp; tests can wait.
github 19:06:33
Fixes <https://github.com/cofacts/rumors-line-bot/issues/239|#239> • From <https://developers.line.biz/console/channel/|developer console> Switch `Method for converting additional information in the LIFF URL` to `Concatenate` • Update richmenu usersetting url to `LIFF_URL?p=setting`
github 19:14:27
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37199483|Build 1274>* • *1* of *1* *(100.0%)* changed or added relevant line in *1* file are covered. • No unchanged relevant lines lost coverage. • Overall coverage remained the same at *86.498%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 20:26:48
We will merge first and just setup 1st custom dimension. Leave 2nd dimension / metric for the future.
github 20:40:21
LGTM! We will track items left in a separate ticket
github 21:11:29
UI: <https://www.figma.com/file/mfsTnlvaMC1MC4aG8tf5YW|https://www.figma.com/file/mfsTnlvaMC1MC4aG8tf5YW>
2021-02-18
mrorz 00:17:32
m.facebook.com
【LINE 更新報你知 :loudspeaker:】 穿新衣:necktie:~戴新帽:billed_cap:~ LIFF 升級新版本,也要帶給大家新的體驗啦! 快快跟上更新的腳步,才能避免出問題:warning: 不要讓年初就輸在起跑點上:runner: 重點整理看這裡 :arrow_down::arrow_down::arrow_down: :four_leaf_clover:項目:LIFF SDK :four_leaf_clover:版本:2.8.0 :four_leaf_clover:時間:2021/02/15 :four_leaf_clover:重點整理: - 取消 LIFF 二次跳轉前的 liff.init() reslove - query...
mrorz 03:08:29
月黑風高就是要來 release ~
現在 Cofacts chatbot 正在測試加入群組的功能唷!
加入群組之後說 `Hi Cofacts` 可以看到他回你訊息
然後群組裡有人貼跟健康相關的謠言,它就會自動回應唷~~

歡迎大家試試看把它加進群組~~
2021-02-19
github 13:50:33
LGTM! We can merge after compressing the images.
github 22:19:06
to see <https://github.com/cofacts/rumors-ai/issues/10|cofacts/rumors-ai#10>
github 22:19:43
☐ test (staging) ☐ production
github 22:28:31
<https://github.com/cofacts/rumors-ai#run|https://github.com/cofacts/rumors-ai#run> <https://github.com/cofacts/rumors-ai#environment-variables|https://github.com/cofacts/rumors-ai#environment-variables>
github 22:29:00
<https://github.com/cofacts/rumors-ai/commit/753f6105832cf8d34fbe8a69a7a0394e6588f30d|753f610>
mrorz 23:44:39
@yutunghsiao19 關於這種三角形底部
我會在 `ReportPage` 下面做一個 component 唷
原理會是用 mask 把三角形裁出來,然後用 negative bottom margin 讓下面的 section 跑下去
image.png
好~
2021-02-20
hsiao 15:24:46
好~
2021-02-22
github 18:33:11
Fix remain issues from PR <https://github.com/cofacts/rumors-line-bot/pull/238|#238> 1. documentation regarding the custom dimensions; and if we should use custom metric instead of custom dimension for user count in chat groups 2. remove excessive comment 3. simplify test case Others 1. Add leave command for room user to kick out chatbot 2. Fix rollbar item 335 [LINE Client] 400: Only group id is acceptable (room/group use different api endpoint to get members count)
github 18:36:50
*Pull Request Test Coverage Report for <https://coveralls.io/builds/37323490|Build 1284>* • *13* of *13* *(100.0%)* changed or added relevant lines in *2* files are covered. • No unchanged relevant lines lost coverage. • Overall coverage increased (+*0.07%*) to *86.776%* * * * * * * *:yellow_heart: - <https://coveralls.io|Coveralls>*
github 18:55:07
Because chatbot may join/leave a group multiple times, we should find the last `Join` action of the `Client Id` to get a more accurate `Group Members Count`. Don't know if there's a better way to handle this condition.
github 22:31:30
As discussed with <https://github.com/bil4444|@bil4444> we want to move report page URL from `/report` to `/impact` • This URL is year neutral; can re-use every year • Means "social impact", which is more specific than "report" <https://user-images.githubusercontent.com/108608/108721818-66adb300-755d-11eb-800e-760599a852ae.png|image>
2021-02-23
github 14:53:57
There is some redundancy.
github 14:59:07
<https://github.com/cofacts/rumors-ai-bow/commit/62ded83511d5fa2b2ab0d049ca0410aada42a38c|62ded83>
github 16:17:15
<https://github.com/cofacts/rumors-ai-bow/commit/2d2738b03bddc285807a37d3101cb92858fd3a71|2d2738b>
github 18:06:08

what happened
我想說跟edit 一起進去好了,我拆不開QQ
mrorz 18:30:40

what happened
anon 19:44:40
@anontw has joined the channel
zoe 20:40:43
Replied to a thread: 2021-02-23 18:06:08
我想說跟edit 一起進去好了,我拆不開QQ
  • 1
Guo-Jim 23:13:36
@guo-jim has joined the channel
2021-02-24
github 01:13:02
continuing from <https://github.com/cofacts/rumors-site/pull/357|#357>
github 01:21:53
• change default image size to 100 • add image size to facebook url • omit avatarData field on non-openpeeps updates, instead of wiping it
github 01:46:24
<https://coveralls.io/builds/37380694|Coverage Status> Coverage increased (+0.007%) to 86.479% when pulling *<https://github.com/cofacts/rumors-api/commit/2902b76d45a5978e93ff3f7548f1b06f68536370|2902b76> on avatars* into *<https://github.com/cofacts/rumors-api/commit/d679bc118185a4df2dcc5dbda464b548a82629c8|d679bc1> on master*.
github 11:00:25
discussion: <https://g0v.hackmd.io/CqKV8gfNSfyuvdQOtq7TlQ#%E6%99%82%E9%96%93%E9%A1%AF%E7%A4%BA|https://g0v.hackmd.io/CqKV8gfNSfyuvdQOtq7TlQ#%E6%99%82%E9%96%93%E9%A1%AF%E7%A4%BA> *as-is* All time display is relative to current time. It was set like this because in server-side rendering, the time zone is GMT, this relative time was chosen by default. *to-be* Use facebook-like time display as discussed in <https://g0v.hackmd.io/CqKV8gfNSfyuvdQOtq7TlQ#%E6%99%82%E9%96%93%E9%A1%AF%E7%A4%BA|https://g0v.hackmd.io/CqKV8gfNSfyuvdQOtq7TlQ#%E6%99%82%E9%96%93%E9%A1%AF%E7%A4%BA> . For time zone issue, we can • keep ISO Timestamp in `&lt;time&gt;` HTML property so that search engine can read the time correctly • apply absolute time display on component mount, which should only trigger on browsers
github 13:08:31
*As-is* The category dialog sorts the category using arbitrary order (same order the API has returned) <https://user-images.githubusercontent.com/108608/108950382-1dff1280-76a1-11eb-9be4-9e491846c290.png|image> *To-be* Per discussed in <https://g0v.hackmd.io/CqKV8gfNSfyuvdQOtq7TlQ#%E6%8E%A8%E8%96%A6%E6%A8%99%E7%B1%A4|20210217>, we should • 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.
github 13:45:36
Got it, thanks for the note!
github 14:18:29
Does this trigger leave webhook? If not, we may need to manually send `ga` here.
github 14:18:29
Thanks for the fix! Let's get it to dev &amp; staging ASAP.
github 15:02:31
nit: since we do not clear `avatarData` when openpeeps is not chosen, I think we can update the test name accordongly.
github 18:11:25
data syncing fails sometimes and stops the whole process
YZWind 19:34:44
@yzwind has joined the channel
hsiao 19:58:37
@bil @mrorz final report 頁有一些缺少和未更新的翻譯,缺少的部分我記錄在這個 google sheets 裡面了,再麻煩你們看看,感謝~
https://docs.google.com/spreadsheets/d/1II6ZgidN8xSniFAFSeoWJI85ZezJm-vTcIP4aZ8hNbE/edit#gid=0
  • 🦒1
zoe 20:47:24
production 是 cofacts-api.g0v.tw -> cofacts.g0v.tw
staging xn--cofacts-api-688w.hacktabl.org -> dev.cofacts.org
所以 prod 不會有登入的問題
  • 1
2021-02-25
Andy Zhao 05:28:42
@dz352 has joined the channel
2021-02-26
github 02:45:58
Implement banner animation and translate impact page
github 14:49:05
We probably want to name this method something like `sanitizeAvatarData` as it returns an object rather than true / false or throws on invalid object.
github 14:49:05
<https://user-images.githubusercontent.com/108608/109265584-bfbd6580-7841-11eb-9a7b-e823b5875315.png|image> Some early comments so far
github 14:49:06
This will create 3 levels of div around the `svg`. The inner most div is created by `circleStyle` in `Peep` (relevant code: <https://github.com/CeamKrier/react-peeps/blob/master/src/peeps/index.tsx#L160|https://github.com/CeamKrier/react-peeps/blob/master/src/peeps/index.tsx#L160> ) I think we can 1. Just wrap 1 div around `&lt;Peep&gt;` 2. put styles in `peepsStyles.circleStyle` to `classes.showcaseWrapper`. 3. remove `circleStyle` prop from `&lt;Peep&gt;` to prevent `react-peeps` from generating extra div that
github 14:49:06
Since `JSON.parse` can be expensive to do in render functions, I suggest isolate it in `useMemo`: Suggested change
github 14:49:06
Suggest using <https://reactjs.org/docs/hooks-reference.html#lazy-initial-state|lazy initialization> since `getInitialAvatarData` is a bit expensive to do on every render Suggested change
github 21:41:20
Thanks for the avatar edit function, it's a real fun to see these vibrant avatars! I have some suggestions regarding data loading &amp; DOM structuring, please take a look
github 21:41:20
Given the fact that • All data in this fields are only required when EditAvatarDialog is opened; they are not required to render a profile page • SSR for these fields will never work due to lack of session cookies I think it makes for sense if we perform a separate `useQuery` right inside render function of `EditProfileDialog` (i.e. after `EditProfileDialog` is opened ) instead of putting its fragment in `UserPageHeader`'s `useQuery`. Plus, we could also drop `loadSelfOnlyFieldsForUser` lazy query &amp; `useEffect` in `ProfilePage` if we load this fragment in `EditProfileDialog`. (Seems that I should the similar to `EditProfileDialogUserData` as well; maybe I will refactor that in the future)
github 21:41:21
It seems that these fields are only used in `EditAvatarDialog`. In this case I suggest adding these fields to `EditAvatarDialogUserData` fragment in `EditAvatarDialog` instead.
github 21:41:21
I think we can add <https://www.apollographql.com/docs/react/data/mutations/#options|`refetchQueries: ['LoadProfilePage']`> to `useMutation(UPDATE_USER)` call in `EditAvatarDialog` instead. In this way, profile page data can be reloaded after user submits avatar.
github 21:41:21
Seems that removing this div can make mobile look even better; buttons can wrap and all buttons become clickable <https://user-images.githubusercontent.com/108608/109304728-a33c2000-7877-11eb-9ea6-e4eaa809b6bd.png|image> And on desktop it looks decent as well.
github 21:41:21
When `ComponentInput` is rendered, `wrapperEl.current` is null; after `AvatarSelector` is rendered, `wrapperEl` is populated, but that does not trigger re-render. `anchorEl` <https://material-ui.com/api/menu/|supports a function>. I think when a function is passed, material-ui will invoke it when menu is opened, thus this can fetch the latest ref value in scope. Suggested change Ref object returned by `useRef` is always an object that has `currrent` property (even just after initialization, it's `{current: null}`) so no need for `?.`. The same applies to `&lt;ColorPicker&gt;` below.
github 21:59:07
LGTM! Thanks for improving the impact page!
github 21:59:07
nit: I think we can use media query for `bgBottom`; in this way we don't need to use Javascript (`isMobile`).
2021-02-28
github 14:24:53
Let's merge first to resolve conflict on i18n translations