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

#40, #41, #43 - add jbrowse circular #184

Merged
merged 50 commits into from
Sep 29, 2023

Conversation

samrichca
Copy link
Member

@samrichca samrichca commented Sep 20, 2023

requires latest (develop) of dms-jbrowse-components

  • add jbrowse circular
  • add dropdown option for linear/circular
  • update error handling

@samrichca samrichca changed the title #41 - add jbrowse circular #40, #41, #43 - add jbrowse circular Sep 20, 2023
Copy link
Member

@justincorrigible justincorrigible left a comment

Choose a reason for hiding this comment

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

great work, Sam! 🎉
I’ll approve this PR, yet would like to see those strings be made reusable constants to prevent bugs if this tabs thing is ever extended.

Btw, it seems the PR is not passing Jenkins.

@joneubank joneubank self-requested a review September 26, 2023 17:12
@samrichca
Copy link
Member Author

@justincorrigible noted about the strings. jenkins is unhappy because our jbrowse plugin isn't updated on npm, i'll follow up on slack

export const RepositoryTabsContext = createContext<RepositoryTabsContextInterface>({
activeTab: undefined,
openTabs: [],
} as unknown as RepositoryTabsContextInterface);
Copy link
Member Author

Choose a reason for hiding this comment

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

has a TS error without 'as unknown as x'. we had this on another context provider before

Copy link
Member

@justincorrigible justincorrigible Sep 27, 2023

Choose a reason for hiding this comment

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

I'll let @joneubank chime in on that one first, but I'm confident there's a more maintainable way to handle this. Also curious to see where else this pattern was deemed necessary, so we can improve things there too.

Copy link
Member Author

Choose a reason for hiding this comment

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

I mixed this up, I used unknown with the tables. there must be a fix here since it worked before without it, but I'm stumped at the moment

Choose a reason for hiding this comment

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

I know youre fixing this but I just want to respond that there is no reason to have double type assertion. In this case we shouldn't be faking our type, instead just provide default values that match the expected type. We overwrite these in the tab implementation immediately anyways:

export const RepositoryTabsContext = createContext<RepositoryTabsContextInterface>({
	handleSwitchTab: () => {},
	handleCloseTab: () => {},
	handleOpenTab: () => {},
	handleUpdateTab: () => {},
	openTabs: [],
});

position="left"
>
<TransparentButton
onClick={() => handleJbrowseOption(itemLabel, closeDropDownFn)}
Copy link
Member

Choose a reason for hiding this comment

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

oh! you went for it in this PR, nice!

this approach is close, but not quite the right solution, as it still creates a new arrow with every render.
I'll open a PR onto this branch to show what I mean.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, not sure how to do this and pass in arguments that aren't attached to the event

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

decided to leave it as an arrow function due to event typing issues

Copy link
Member

@justincorrigible justincorrigible left a comment

Choose a reason for hiding this comment

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

LGTM!

@samrichca samrichca merged commit fa1420b into feat/jbrowsemvp-arranger3 Sep 29, 2023
3 checks passed
@samrichca samrichca deleted the 41-jbrowse-btn-dropdown branch September 29, 2023 19:05
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.

3 participants