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

fix: notebook updates #1485

Merged
merged 7 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@
"description": "Enable dbt docs collaboration.",
"default": true
},
"dbt.enableTeammates": {
"type": "boolean",
"description": "Enable AltimateAI teammates feature.",
"default": true
},
"dbt.disableQueryHistory": {
"type": "boolean",
"description": "Disable Query history and bookmarks",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2497,6 +2497,8 @@ project_name="${e.getProjectName()}"
a.clearOutput(),
e.document.languageId)
) {
case "markdown":
break;
case "python":
this.telemetry.startTelemetryEvent(
u.TelemetryEvents["Notebook/Execute"],
Expand Down
30 changes: 0 additions & 30 deletions src/webview_provider/altimateWebviewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,6 @@ export class AltimateWebviewProvider implements WebviewViewProvider {
t.onEvent(d as SharedStateEventEmitterProps),
),
);

workspace.onDidChangeConfiguration(
(e) => {
if (e.affectsConfiguration("dbt.enableTeammates")) {
const isEnabled = workspace
.getConfiguration("dbt")
.get<boolean>("enableTeammates", false);
const event = isEnabled ? "TeammatesEnabled" : "TeammatesDisabled";
this.telemetry.sendTelemetryEvent(event);
if (this._panel) {
this.sendResponseToWebview({
command: "teammatesUpdated",
data: isEnabled,
});
}
}
},
this,
this._disposables,
);
}

public isWebviewView(
Expand Down Expand Up @@ -243,16 +223,6 @@ export class AltimateWebviewProvider implements WebviewViewProvider {

try {
switch (command) {
case "getTeammatesStatus": {
const isEnabled = workspace
.getConfiguration("dbt")
.get<boolean>("enableTeammates", false);
this.sendResponseToWebview({
command: "teammatesUpdated",
data: isEnabled,
});
break;
}
case "configEnabled":
this.handleSyncRequestFromWebview(
syncRequestId,
Expand Down
26 changes: 21 additions & 5 deletions webview_panels/src/lib/altimate/altimate-components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ export declare const ApiHelper: {

export declare const Badge: ({ tooltip, ...props }: Props_5) => JSX_2.Element;

export declare const Chatbot: ({ loading, onRequest, sessionId: sessionIdProp, onFollowupRequest, ...props }: Props_9) => JSX_2.Element;
export declare const Chatbot: ({ loading, onRequest, sessionId: sessionIdProp, onFollowupRequest, frontendUrl, ...props }: Props_9) => JSX_2.Element;

export declare const ChatTriggerLink: ({ text }: {
text: string;
}) => JSX_2.Element;

export declare interface Citation {
id: string;
content: string;
taskLabel: TaskLabels;
}

export declare const Citations: ({ citations, frontendUrl, }: {
citations?: Citation[];
frontendUrl: string;
}) => JSX.Element | null;

export declare class CLL {
static isCancelled: boolean;
static inProgress: boolean;
Expand Down Expand Up @@ -350,12 +361,10 @@ declare interface Props_8 {

declare interface Props_9 extends ProChatProps<any> {
loading?: boolean;
onRequest: (messages: ChatMessage[], sessionId: string, onStatusUpdate: (info: {
type: string;
message: string;
}) => void) => any;
onRequest: (messages: ChatMessage[], sessionId: string, onStatusUpdate: (info: StatusInfoMessage) => void) => any;
sessionId?: string;
onFollowupRequest?: (sessionId: string) => Promise<string[] | undefined>;
frontendUrl: string;
}

export declare interface SelectedColumn {
Expand Down Expand Up @@ -397,6 +406,13 @@ export declare type StaticLineageDetails = Record<string, {
join_type?: string;
}>;

export declare interface StatusInfoMessage {
type: "info" | "agent_outcome" | "citations";
message: string;
citations?: Citation[];
id?: string;
}

export declare interface Table {
table: string;
label: string;
Expand Down
49 changes: 25 additions & 24 deletions webview_panels/src/lib/altimate/altimate-components.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
import { A as o, B as t, m as n, p as i, o as r, n as m, r as C, t as T, C as l, E as c, k as p, i as g, h as v, D as L, I as u, x as h, l as B, L as M, P as d, F as A, J as b, H as k, q as y, y as F, z as P, w as x, T as D, G as I, v as S } from "./main.js";
import { A as o, B as t, m as n, p as i, o as r, q as C, n as m, t as T, v as l, C as c, F as p, k as g, i as v, h as L, D as u, I as h, y as B, l as M, L as d, P as A, G as b, K as k, J as y, r as F, z as P, E as x, x as D, T as I, H as S, w as f } from "./main.js";
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve import statement readability by using meaningful aliases.

The current use of single-letter aliases (o, t, n, etc.) makes the code harder to maintain and understand. Consider using more descriptive aliases that reflect the actual component names.

-import { A as o, B as t, m as n, p as i, o as r, q as C, n as m, t as T, v as l, C as c, F as p, k as g, i as v, h as L, D as u, I as h, y as B, l as M, L as d, P as A, G as b, K as k, J as y, r as F, z as P, E as x, x as D, T as I, H as S, w as f } from "./main.js";
+import {
+  A as ApiHelper,
+  B as Badge,
+  C as Citations,
+  // ... continue with meaningful aliases
+} from "./main.js";

Committable suggestion skipped: line range outside the PR's diff.

import "reactstrap";
export {
o as ApiHelper,
t as Badge,
n as CLL,
i as ChatTriggerLink,
r as Chatbot,
C as Citations,
m as CllEvents,
C as CoachForm,
T as CoachFormButton,
l as CodeBlock,
c as ContentCategory,
p as ConversationGroupProvider,
g as ConversationInputForm,
v as ConversationSources,
L as DbtDocs,
u as IconButton,
h as Learnings,
B as Lineage,
M as LoadingButton,
d as PersonalizationScope,
A as TaskLabels,
b as TeamMateActionType,
k as TeamMateAvailability,
y as TeamMateProvider,
F as TeamMates,
P as TeamMatesConfig,
x as TeammateActions,
D as Tooltip,
I as learningSchema,
S as useTeamMateContext
T as CoachForm,
l as CoachFormButton,
c as CodeBlock,
p as ContentCategory,
g as ConversationGroupProvider,
v as ConversationInputForm,
L as ConversationSources,
u as DbtDocs,
h as IconButton,
B as Learnings,
M as Lineage,
d as LoadingButton,
A as PersonalizationScope,
b as TaskLabels,
k as TeamMateActionType,
y as TeamMateAvailability,
F as TeamMateProvider,
P as TeamMates,
x as TeamMatesConfig,
D as TeammateActions,
I as Tooltip,
S as learningSchema,
f as useTeamMateContext
};
2 changes: 1 addition & 1 deletion webview_panels/src/lib/altimate/main.css

Large diffs are not rendered by default.

Loading