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

Console refresh #301

Merged
merged 13 commits into from
Jul 30, 2024
Merged

Console refresh #301

merged 13 commits into from
Jul 30, 2024

Conversation

asutula
Copy link
Contributor

@asutula asutula commented Jul 19, 2024

In the process of hunting down our data table bug, I started writing a stripped down version of the console that used typescript very thoroughly, and had a more simple view hierarchy. This made it easier to hunt down that bug. Turned out it was a good starting place for an updated console that is more consistent with our visual style. Adds support for multiple mutating statements.

asutula added 5 commits July 18, 2024 21:34
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Copy link

vercel bot commented Jul 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2024 4:14pm

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
@@ -7,7 +7,7 @@ export default async function LayoutTeam({
}) {
return (
<div className="flex flex-1">
<div className="sticky top-[3.5rem] h-[calc(100vh-3.55rem)] w-52 flex-shrink-0 overflow-y-auto overflow-x-hidden bg-card">
<div className="sticky top-[3.507rem] h-[calc(100vh-3.507rem)] w-52 flex-shrink-0 overflow-y-auto overflow-x-hidden bg-card">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unreleated. Just finding the right magic number for our header height so things that sit below it are positioned properly.

Comment on lines +21 to +26
userForAddress: publicProcedure
.input(z.object({ address: z.string().trim().min(1) }))
.query(async ({ input }) => {
const res = await store.users.userForAddress(input.address);
return res;
}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a new API, and you'll see the store support for it as well.

Comment on lines +12 to +17
const ConsoleTabs = dynamic(
async () => await import("@/components/console-tabs"),
{
ssr: 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.

The console tabs data are stored in local storage, so we can't have them rendered on the server at all, or we'll get a hydration mismatch error. This NextJS helper is a nice way of doing that.


return (
<main className="flex-1 p-4">
<Console environmentId={environment.id} />
<main className="flex min-h-[calc(100vh-3.507rem)] p-4">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For a console interface, I want to to always take up at least all the available screen height. Required using this magic number to account for the height of our sticky header.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to an easier to use/cleaner code editing component that doesn't require this external css and js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use the new WalletStatus component to display the connect wallet status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

New component that displays the currently connect wallet address as well as other information related to it. We can use this anywhere we support on chain interactions (editing table data, deploying tables, console, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a helper to do the thing we always need to do. We should put this in a shared package at some point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A custom hook that returns the table permissions for whatever the connected account is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A custom hook that wraps the wagmi useAccount to make it easier to use and deal with the hydration mismatch error caused by the wagmi version.

@asutula asutula marked this pull request as ready for review July 30, 2024 16:39
@asutula asutula requested a review from joewagner July 30, 2024 16:40
Copy link
Contributor

@joewagner joewagner left a comment

Choose a reason for hiding this comment

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

Nicely done! Lot's of great improvements here

@asutula asutula merged commit 81018c1 into main Jul 30, 2024
4 checks passed
@asutula asutula deleted the asutula/console-v2 branch July 30, 2024 17:14
asutula added a commit that referenced this pull request Aug 10, 2024
* (nonce) ensure incrby does not remove ttl (#303)

* Console refresh (#301)

* wip on new console

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* better layout for console and data table

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* more query validation, multiple statement support

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old files

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old code editor and deps

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* layout fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* working tabs

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support esc key to cancel edit tab name

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* persisted tab data

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* shared wallet status component and supporting changes

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* little css cleanup

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* store tab data per project

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* combining conditional logic

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>

* native mode as project setting, scope tab results to env

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support native mode in studio aliases

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* cli fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* add native_mode columns to cli tests

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Joe Wagner <joewagner@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>
asutula added a commit that referenced this pull request Aug 12, 2024
* (nonce) ensure incrby does not remove ttl (#303)

* Console refresh (#301)

* wip on new console

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* better layout for console and data table

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* more query validation, multiple statement support

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old files

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old code editor and deps

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* layout fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* working tabs

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support esc key to cancel edit tab name

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* persisted tab data

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* shared wallet status component and supporting changes

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* little css cleanup

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* store tab data per project

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* combining conditional logic

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>

* native mode as project setting, scope tab results to env

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support native mode in studio aliases

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* cli fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* add native_mode columns to cli tests

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Joe Wagner <joewagner@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>
asutula added a commit that referenced this pull request Aug 12, 2024
* Native mode (#308)

* (nonce) ensure incrby does not remove ttl (#303)

* Console refresh (#301)

* wip on new console

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* better layout for console and data table

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* more query validation, multiple statement support

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old files

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* remove old code editor and deps

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* layout fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* working tabs

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support esc key to cancel edit tab name

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* persisted tab data

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* shared wallet status component and supporting changes

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* little css cleanup

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* store tab data per project

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* combining conditional logic

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>

* native mode as project setting, scope tab results to env

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* support native mode in studio aliases

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* cli fix

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* add native_mode columns to cli tests

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Joe Wagner <joewagner@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>

* try out trpc utils invalidate

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

* fix missing nativeMode form value

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>

---------

Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
Co-authored-by: Aaron Sutula <528969+asutula@users.noreply.github.com>
Co-authored-by: Aaron Sutula <asutula@users.noreply.github.com>
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