-
Notifications
You must be signed in to change notification settings - Fork 4
eng-1144: DiscourseContext UI disappears #602
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ import Charts from "./Charts"; | |
| import Timeline from "./Timeline"; | ||
| import Kanban from "./Kanban"; | ||
| import MenuItemSelect from "roamjs-components/components/MenuItemSelect"; | ||
| import { RoamBasicNode } from "roamjs-components/types"; | ||
| import type { RoamBasicNode } from "roamjs-components/types/native"; | ||
| import { render as renderToast } from "roamjs-components/components/Toast"; | ||
| import { Column, Result } from "~/utils/types"; | ||
| import updateBlock from "roamjs-components/writes/updateBlock"; | ||
|
|
@@ -238,7 +238,7 @@ type ResultsViewComponent = (props: { | |
| preventSavingSettings?: boolean; | ||
| onEdit?: () => void; | ||
| onDeleteQuery?: () => void; | ||
| onRefresh: (loadInBackground?: boolean) => void; | ||
| onRefresh: (ignoreCache?: boolean) => void; | ||
| globalFiltersData?: Record<string, Filters>; | ||
| globalPageSize?: number; | ||
| isEditBlock?: boolean; | ||
|
|
@@ -1369,7 +1369,7 @@ const ResultsView: ResultsViewComponent = ({ | |
| <Kanban | ||
| data={allProcessedResults} | ||
| layout={layout} | ||
| onQuery={() => onRefresh(true)} | ||
| onQuery={() => onRefresh()} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add some context as to why this change was made, please? Kanban quite seems unrelated to discourse context UI.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is because I removed the loadInBackground flag, so I removed the one call instance which seemed to be using it. So it depends on what we decide to do with that flag, above.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, well "load in background" can be statically
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. statically false, but otherwise agreed. |
||
| resultKeys={columns} | ||
| parentUid={parentUid} | ||
| views={views} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadInBackgroundis 'used' in QueryBuilder.tsx. If we are changing this, should probably remove theloadInBackgroundreference.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I missed that one, thanks. And I agree with the quotation marks around 'used'.
Two things I could do: Remove the loadInBackground reference, since it does so little; (and probably just not call setLoading, but also a decision);
OR add the parameter back, and have a signature with two parameters on the type everywhere.
Which do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove. But keep the same behavior (which is
setLoading(true)I believe)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the linear comment did not carry, copying) Done. onRefresh is called twice, this time with true (hence setLoading(true) as you say, which amounts to load in background being statically false, not true as you say in the other comment.) and in the DiscourseContext.tsx:366 useEffect, where it used to be false. I think this was to avoid a "loading" flicker on first display. I think this flicker is very short, accurately represents processing, and not worth another parameter to suppress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. onRefresh is called twice, this time with true (hence
setLoading(true)as you say, which amounts to load in background being statically false, not true as you say in the other comment.) and in the DiscourseContext.tsx:366useEffect, where it used to be false. I think this was to avoid a "loading" flicker on first display. I think this flicker is very short, accurately represents processing, and not worth another parameter to suppress.