Skip to content
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

✨ Workspace #140

Merged
merged 19 commits into from
Jul 31, 2024
Merged

✨ Workspace #140

merged 19 commits into from
Jul 31, 2024

Conversation

foysalit
Copy link
Contributor

@foysalit foysalit commented Jun 27, 2024

This PR adds a globally available workspace that allows viewing and actioning subjects in bulk.

Screen.Recording.2024-07-26.at.13.05.40.mov

Preview of actioning in bulk

Screen.Recording.2024-07-26.at.13.03.43.mov

Preview of adding subjects to workspace

Copy link

render bot commented Jun 27, 2024

Copy link

render bot commented Jun 27, 2024

@foysalit foysalit changed the title 🚧 Workspace Workspace Jul 26, 2024
@foysalit foysalit changed the title Workspace ✨ Workspace Jul 26, 2024
@foysalit foysalit requested review from devinivy and bnewbold July 26, 2024 11:07
const { data: workspaceList } = useWorkspaceList()
const { mutate: addToWorkspace } = useWorkspaceAddItemsMutation()
const { mutate: removeFromWorkspace } = useWorkspaceRemoveItemsMutation()
const isInWorkspace = workspaceList?.find((uri) => uri === item.post.uri)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for convenience!

Suggested change
const isInWorkspace = workspaceList?.find((uri) => uri === item.post.uri)
const isInWorkspace = workspaceList?.includes(item.post.uri)

@@ -0,0 +1,20 @@
import { usePathname, useSearchParams, useRouter } from 'next/navigation'

export const useWorkspaceOpener = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines 50 to 51
.catch(() => {
statusBySubject[subject] = null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is another place a developer error could disappear into the void. Up to you, but I am still a proponent for ensuring they get logged. It's no problem when the error is something we expect like a network error, but when it's an unanticipated programmer error it's nice for those to be detectable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging with console.error now

Copy link
Collaborator

@devinivy devinivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! This will be great. We should just see what's going on with that failing test suite.

@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
missingSuspenseWithCSRBailout: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are already wrapping some pages in suspense boundary but there's really no issue not wrapping them so turning this off is fine.

@@ -31,7 +31,7 @@
"eslint-config-next": "13.4.8",
"kbar": "^0.1.0-beta.45",
"lande": "^1.0.10",
"next": "14.0.1",
"next": "14.2.5",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In latest version, they fixed an issue that would cause rsc requests to fail when useSearchParams is used in a component that is rendered in the page. we never had this issue until we had to pass useSearchParams at the top level.

@foysalit foysalit merged commit 1d93086 into main Jul 31, 2024
3 checks passed
@matthieusieben matthieusieben deleted the workspace branch November 15, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants