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

Function definition editor widget #11655

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open

Conversation

Frizi
Copy link
Contributor

@Frizi Frizi commented Nov 25, 2024

Pull Request Description

Fixes #11406

Also refactored the right panel state into its own store, so it is less coupled with the graph editor.

image

The function definition widget tree displays the icon, name and all arguments. The name is editable, everything else right now is just read-only. The icons next to the arguments are just placeholders intended to be replaced with a "drag handle" icon.

Also fixed issues with missing rounded corners on the ag-grid widget.
image

Copy link

github-actions bot commented Nov 25, 2024

🧪 Storybook is successfully deployed!

📊 Dashboard:

/**
* Find smallest index at which two arrays differ. Returns an index past the array (i.e. array length) when both arrays are equal.
*/
export function findDifferenceIndex<T>(
Copy link
Contributor

Choose a reason for hiding this comment

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

This could use some tests, like expect(findDifferenceIndex([null], [null])).toBe(1)

margin: 4px 8px;
padding: 4px;

/* TODO */
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. I completely forgot about it. I'm not sure what to do about it though at this point, since we don't have a known output type that would be used to color the node. I will just expand the comment here for now, explaining the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually ended up looking for defined group or output node's color, if available. I think this will be complete enough for current implementation.

@@ -80,6 +72,7 @@ const innerInput = computed(() => {
* handling deletions of arguments and rewriting the applications to named as appropriate.
*/
function handleArgUpdate(update: WidgetUpdate): boolean {
console.log('handleArgUpdate', update)
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover logging (here and in other files)

@@ -745,8 +745,8 @@ config.setToolbar(
overflow: hidden;
}
.TableVisualization > .ag-theme-alpine > :deep(.ag-root-wrapper.ag-layout-normal) {
border-radius: 0 0 var(--radius-default) var(--radius-default);
.TableVisualization:deep(.ag-root-wrapper) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this still need a :deep selector?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the .ag-root-wrapper is generated outside of vue's context, so it doesn't logically belong to a component. That makes :deep necessary.

Copy link
Contributor

@kazcw kazcw Nov 26, 2024

Choose a reason for hiding this comment

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

I meant the deep selector, :deep(.ag-root-wrapper). Not just the :deep pseudoclass part of the selector.

@@ -12,9 +12,7 @@ export type WidgetComponent<T extends WidgetInput> = Component<WidgetProps<T>>

export namespace WidgetInput {
/** Returns widget-input data for the given AST expression or token. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Docs are outdated, here and below

] as const satisfies TabButton[]
const isFullscreen = ref(false)

const mainMarkdownDocs = new Y.Doc().getText() // TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a stub


const props = defineProps<{ aiMode: boolean }>()

// type Tabs = (typeof tabButtons)[number]['tab']
Copy link
Contributor

Choose a reason for hiding this comment

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

Commented code

const width = toRef(persisted, 'graphRightDockWidth')

const cbVisible = ref(true)
const cbTab = ref('help')
Copy link
Contributor

Choose a reason for hiding this comment

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

The tab names seem to be magic strings, which risks bugs if we change the available tabs in the future.

@farmaazon farmaazon linked an issue Nov 26, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants