Skip to content

Internal: AI - Added session and generate ids [ED-12962]#24477

Merged
matipojo merged 22 commits intoelementor:mainfrom
matipojo:ED-12962-new-add-relevant-ids
Dec 7, 2023
Merged

Internal: AI - Added session and generate ids [ED-12962]#24477
matipojo merged 22 commits intoelementor:mainfrom
matipojo:ED-12962-new-add-relevant-ids

Conversation

@matipojo
Copy link
Copy Markdown
Member

@matipojo matipojo commented Dec 3, 2023

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

file name kebab-case? (also elementorCommon.js)

import { createTheme } from '@elementor/ui';
import { StyledEngineProvider } from '@elementor/ui/styles';
import { ThemeProvider } from '@mui/material/styles';
import {} from '@mui/material';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
import {} from '@mui/material';

import PropTypes from 'prop-types';

// https://stackoverflow.com/a/77460953 - Thanks.
export default class TestProvider extends React.Component {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
export default class TestProvider extends React.Component {
export default class TestThemeProvider extends React.Component {

or maybe

Suggested change
export default class TestProvider extends React.Component {
export default class TransitionlessThemeProvider extends React.Component {

contrastText: '#242105',
},
},
// Disable Transitions when running tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i would move this comment to the top, since it's related to this whole component

Comment on lines +76 to +78
generateId: generateIdRef.current,
batchId,
requestId: `request-${ getUniqueId() }`,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why those IDs are being handled here and not in the backend?
If I understand correctly, seems like the only client-dependant ID is the session, am I right?

Copy link
Copy Markdown
Member Author

@matipojo matipojo Dec 6, 2023

Choose a reason for hiding this comment

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

The backend is stateless, so it's blind to the batch to a regenerate.

assertUniqueIds( defaultExpectedUniqueIds );
} );

it( 'Should keep the same sessionId and generateID on regenerate, but discard other ids', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't also have now "keep editorSessionId" or something?

Comment on lines +111 to +115
await clickEditPromptButton();

// Act - Should keep only the sessionId, on a new prompt.
await addPromptAndGenerate( 'test2' );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥

@matipojo matipojo merged commit 313b798 into elementor:main Dec 7, 2023
@matipojo matipojo deleted the ED-12962-new-add-relevant-ids branch December 7, 2023 08:32
matipojo added a commit to matipojo/elementor that referenced this pull request Dec 7, 2023
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