Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): move history into sidebar#11413

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 11 commits intomainfrombq/update-history-on-ws-page
Jan 5, 2024

Conversation

BrunoQuaresma
Copy link
Collaborator

Screen.Recording.2024-01-04.at.13.50.39.mov

@BrunoQuaresmaBrunoQuaresma requested a review froma teamJanuary 4, 2024 18:47
@BrunoQuaresmaBrunoQuaresma self-assigned thisJan 4, 2024
@BrunoQuaresmaBrunoQuaresma requested review fromcode-asher and removed request fora teamJanuary 4, 2024 18:47
@Parkreiner
Copy link
Member

Ran out of time to start on this today, but I'll be starting on this first thing tomorrow morning!

Copy link
Member

@ParkreinerParkreiner left a comment

Choose a reason for hiding this comment

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

Looks really good! Just had a few niggling comments

return <Link css={styles.sidebarItem} {...props} />;
};

export const SidebarItem = (props: HTMLAttributes<HTMLButtonElement>) => {
Copy link
Member

@ParkreinerParkreinerJan 5, 2024
edited
Loading

Choose a reason for hiding this comment

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

Just for future-proofing, do you think it's worth explicitly pulling thetype attribute out and setting its default value tobutton?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Not sure if I got it... do you have a code sample?

Copy link
Member

@ParkreinerParkreinerJan 5, 2024
edited
Loading

Choose a reason for hiding this comment

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

Sorry, just realized that the comment got garbled by a stray backtick

Now that I'm a little more awake, I think my suggestion would be overkill, but I was talking about this:

exportconstSidebarItem=({  type="button",  ...delegatedProps}:HTMLAttributes<HTMLButtonElement>)=>{return<buttoncss={styles.sidebarItem}type={type}{...props}/>;};

<div css={{ padding: 16 }}>
<LoadingButton
fullWidth
onClick={() => buildsQuery.fetchNextPage()}
Copy link
Member

Choose a reason for hiding this comment

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

Could this be simplified toonClick={buildsQuery.fetchNextPage}?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

No, because theonClick event pass an Event object and thefetchNextPage receives a different argument type

// Watch workspace changes
const updateWorkspaceData = useEffectEvent(
async (newWorkspaceData: Workspace) => {
if (!workspace) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's just because it's still early for me, but I got confused for a second when reading this code because I didn't realize thought the check was for the old workspace, and not the new one

Do you think it's worth renamingworkspace tocurrentWorkspace, to make the difference between new and old a little more clear?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

This workspace is a prop from the WorkspacePage so I don't think renaming it would make it look good at the component level. Eg.<WorkspacePage currentWorkspace={workspace} /> does not make too much sense to me.


{buildLogs}

{typeof resources !== "undefined" && resources.length > 0 && (
Copy link
Member

Choose a reason for hiding this comment

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

Could the condition be simplified toresources?.length > 0?

Copy link
CollaboratorAuthor

@BrunoQuaresmaBrunoQuaresmaJan 5, 2024
edited
Loading

Choose a reason for hiding this comment

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

No, because typescript will throw an error:

Screenshot 2024-01-05 at 11 59 55

But it can be something likeresources && resources.length > 0

Copy link
Member

Choose a reason for hiding this comment

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

Oh, that's my mistake – this is one of those things that's technically safe in JavaScript (undefined > 0 evaluates tofalse), but TS wouldn't be happy

@BrunoQuaresmaBrunoQuaresma merged commitc428395 intomainJan 5, 2024
@BrunoQuaresmaBrunoQuaresma deleted the bq/update-history-on-ws-page branchJanuary 5, 2024 16:32
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 5, 2024
@BrunoQuaresma
Copy link
CollaboratorAuthor

Related to#11491

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ParkreinerParkreinerParkreiner approved these changes

@code-ashercode-asherAwaiting requested review from code-ashercode-asher was automatically assigned from coder/ts

Assignees

@BrunoQuaresmaBrunoQuaresma

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@BrunoQuaresma@Parkreiner

[8]ページ先頭

©2009-2025 Movatter.jp