Skip to content

Commit b319386

Browse files
Merge upstream feature/distributed-demo into main
2 parents ffae25d + d2ca2ad commit b319386

301 files changed

Lines changed: 17701 additions & 8916 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/agents/expert-react-frontend-engineer.agent.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
description: "Expert React 19.2 frontend engineer specializing in modern hooks, Server Components, Actions, TypeScript, and performance optimization"
33
name: "Expert React Frontend Engineer"
44
tools: ["search/changes", "search/codebase", "edit/editFiles",
5-
"vscode/extensions", "web/fetch", "web/githubRepo",
6-
"vscode/getProjectSetupInfo", "vscode/installExtension",
7-
"vscode/newWorkspace", "vscode/runCommand", "read/problems",
8-
"execute/getTerminalOutput", "execute/runInTerminal",
9-
"read/terminalLastCommand", "read/terminalSelection",
10-
"execute/createAndRunTask", "execute/getTaskOutput",
11-
"execute/runTask", "execute/runTests", "search",
12-
"search/searchResults", "read/terminalLastCommand",
13-
"read/terminalSelection", "execute/testFailure", "search/usages",
14-
"vscode/vscodeAPI"]
5+
"vscode/extensions", "web/fetch", "web/githubRepo",
6+
"vscode/getProjectSetupInfo", "vscode/installExtension",
7+
"vscode/newWorkspace", "vscode/runCommand", "read/problems",
8+
"execute/getTerminalOutput", "execute/runInTerminal",
9+
"read/terminalLastCommand", "read/terminalSelection",
10+
"execute/createAndRunTask", "execute/getTaskOutput",
11+
"execute/runTask", "execute/runTests", "search",
12+
"search/searchResults", "read/terminalLastCommand",
13+
"read/terminalSelection", "execute/testFailure", "search/usages",
14+
"vscode/vscodeAPI"]
1515
---
1616

1717
# Expert React Frontend Engineer

.gitignore

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ deploy/services/gitlab/config/
196196

197197
# config files
198198
services.env
199-
credentials.csv
200199
deploy/services/certs/*
201200
!deploy/services/certs/services.foo.com
202201
deploy/services/cli/certs/*
203-
deploy/services/cli/config/
204202
deploy/services/cli/data
205203

206204
# qlty config
@@ -212,21 +210,36 @@ deploy/services/cli/data
212210
*.coverage
213211
coverage.xml
214212

213+
214+
deploy/services/cli/revenv/
215+
215216
# Copied build artifacts (generated by build.py)
216217
deploy/services/cli/dtaas_services/config/
217218
deploy/services/cli/dtaas_services/data/
219+
deploy/services/cli/dtaas_services/certs/
220+
deploy/services/cli/dtaas_services/log/
218221
deploy/services/cli/dtaas_services/compose.services.secure.yml
219222
deploy/services/cli/dtaas_services/compose.thingsboard.secure.yml
220223
#ignore developer files
221224
docker/.env
222225
docker/conf.dev
223-
deploy/services/data
224-
deploy/services/config
225-
deploy/services/cli/compose.services.secure.yml
226226

227-
deploy/services/cli/data
227+
# Deploy services data
228+
deploy/services/data/*
229+
!deploy/services/data/.gitkeep
230+
deploy/services/data/*/*
231+
!deploy/services/data/*/.gitkeep
232+
deploy/services/cli/config/influxdb
233+
234+
deploy/services/cli/log/thingsboard
235+
236+
deploy/services/config/credentials.csv
237+
deploy/services/cli/config/credentials.csv
228238
deploy/services/cli/config
239+
deploy/services/cli/compose.services.secure.yml
240+
deploy/services/cli/compose.thingsboard.secure.yml
241+
229242
deploy/services/cli/test-output
230243

231244
# local research papers
232-
.research-papers
245+
.research-papers

CLAUDE.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# CLAUDE.md
2+
3+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with
4+
project-specific instructions as needed.
5+
6+
**Tradeoff:** These guidelines bias toward caution over speed.
7+
For trivial tasks, use judgment.
8+
9+
## 1. Think Before Coding
10+
11+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
12+
13+
Before implementing:
14+
15+
- State your assumptions explicitly. If uncertain, ask.
16+
- If multiple interpretations exist, present them — don't pick silently.
17+
- If a simpler approach exists, say so. Push back when warranted.
18+
- If something is unclear, stop. Name what's confusing. Ask.
19+
20+
## 2. Simplicity First
21+
22+
**Minimum code that solves the problem. Nothing speculative.**
23+
24+
- No features beyond what was asked.
25+
- No abstractions for single-use code.
26+
- No "flexibility" or "configurability" that wasn't requested.
27+
- No error handling for impossible scenarios.
28+
- If you write 200 lines and it could be 50, rewrite it.
29+
30+
Ask yourself: "Would a senior engineer say this is overcomplicated?"
31+
If yes, simplify.
32+
33+
## 3. Surgical Changes
34+
35+
**Touch only what you must. Clean up only your own mess.**
36+
37+
When editing existing code:
38+
39+
- Don't "improve" adjacent code, comments, or formatting.
40+
- Don't refactor things that aren't broken.
41+
- Match existing style, even if you'd do it differently.
42+
- If you notice unrelated dead code, mention it — don't delete it.
43+
44+
When your changes create orphans:
45+
46+
- Remove imports/variables/functions that YOUR changes made unused.
47+
- Don't remove pre-existing dead code unless asked.
48+
49+
The test: Every changed line should trace directly to the user's request.
50+
51+
## 4. Goal-Driven Execution
52+
53+
**Define success criteria. Loop until verified.**
54+
55+
Transform tasks into verifiable goals:
56+
57+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
58+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
59+
- "Refactor X" → "Ensure tests pass before and after"
60+
61+
For multi-step tasks, state a brief plan:
62+
63+
```text
64+
1. [Step] → verify: [check]
65+
2. [Step] → verify: [check]
66+
3. [Step] → verify: [check]
67+
```
68+
69+
Strong success criteria let you loop independently.
70+
Weak criteria ("make it work") require constant clarification.
71+
72+
---
73+
74+
**These guidelines are working if:** fewer unnecessary changes in diffs,
75+
fewer rewrites due to overcomplication, and clarifying questions
76+
come before implementation rather than after mistakes.

client/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,24 @@ one project runner in your GitLab profile. Follow the steps below:
105105

106106
1. Login to the GitLab profile that will be used as the OAuth provider.
107107

108-
1. Navigate to the *DTaaS* group and select the project named after your
108+
1. Navigate to the _DTaaS_ group and select the project named after your
109109
GitLab username.
110110

111111
1. In the project menu, go to Settings and select CI/CD.
112112

113-
1. Expand the **Runners** section and click on *New project runner*. Follow the
113+
1. Expand the **Runners** section and click on _New project runner_. Follow the
114114
configuration instructions carefully:
115115
- Add **linux** as a tag during configuration.
116-
- Click on *Create runner*.
116+
- Click on _Create runner_.
117117
- Ensure GitLab Runner is installed before proceeding. Depending on your
118118
environment, you will be shown the correct command to install GitLab Runner.
119119
- Once GitLab Runner is installed, follow these steps to register the runner:
120120
- Copy and paste the command shown in the GitLab interface into your command
121121
line to register the runner. It includes a URL and a token for your specific
122122
GitLab instance.
123-
- Choose *docker* as executor when prompted by the command line.
123+
- Choose _docker_ as executor when prompted by the command line.
124124
- Choose the default docker image. You must use an image based on Linux,
125-
like the default one (*ruby:2.7*).
125+
like the default one (_ruby:2.7_).
126126

127127
You can manually verify that the runner is available to pick up jobs by running
128128
the following command:
@@ -136,8 +136,8 @@ It can also be used to reactivate offline runners during subsequent sessions.
136136
## Digital Twins page preview
137137

138138
In the Workbench section, there is a link to preview the **Digital Twins**
139-
page. The GitLab account used as OAuth provider must have a *DTaaS* group,
140-
a project under your username, and a *digital_twins* folder which contains
139+
page. The GitLab account used as OAuth provider must have a _DTaaS_ group,
140+
a project under your username, and a _digital_twins_ folder which contains
141141
the Digital Twins.
142142

143143
In the Manage tab, you can read the README.md file of the selected Digital

client/compose.client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ services:
55
volumes:
66
- ./config/test.js:/dtaas/client/build/env.js
77
ports:
8-
- "4000:4000"
8+
- '4000:4000'

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@into-cps-association/dtaas-web",
3-
"version": "0.10.2",
3+
"version": "0.10.3",
44
"description": "Web client for Digital Twin as a Service (DTaaS)",
55
"main": "index.tsx",
66
"author": "prasadtalasila <prasad.talasila@gmail.com> (http://prasad.talasila.in/)",

client/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

client/src/components/LinkButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ interface IconButtonData {
2626
}
2727
const getIconButtons = (buttons: KeyLinkPair[]): IconButtonData[] =>
2828
buttons.map((button) => {
29-
const iconData = LinkIcons[button.key.toUpperCase()];
29+
const iconData = LinkIcons[button.key.toUpperCase()] ?? LinkIcons.NO_ICON;
3030

3131
return {
3232
link: button.link,

client/src/preview/components/asset/AddToCartButton.tsx renamed to client/src/components/asset/AddToCartButton.tsx

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
import { Button } from '@mui/material';
22
import LibraryAsset from 'model/backend/libraryAsset';
3-
import useCart from 'preview/store/CartAccess';
3+
import useCart from 'model/store/CartAccess';
44
import { useSelector } from 'react-redux';
5-
import { selectAssetByPathAndPrivacy } from 'preview/store/assets.slice';
5+
import { selectAssetByPathAndPrivacy } from 'model/store/assets.slice';
66

77
interface AddToCartButtonProps {
8-
assetPath: string;
9-
assetPrivacy: boolean;
8+
readonly assetPath: string;
9+
readonly assetPrivacy: boolean;
1010
}
1111

12+
// Helper to check if asset is in cart
13+
const isAssetInCart = (
14+
cartAssets: LibraryAsset[],
15+
asset: LibraryAsset,
16+
): boolean =>
17+
cartAssets.some(
18+
(item: LibraryAsset) =>
19+
item.path === asset.path && item.isPrivate === asset.isPrivate,
20+
);
21+
1222
function AddToCartButton({ assetPath, assetPrivacy }: AddToCartButtonProps) {
1323
const { state: cartState, actions } = useCart();
1424
const asset = useSelector(
1525
selectAssetByPathAndPrivacy(assetPath, assetPrivacy),
1626
) as LibraryAsset;
1727

18-
const isInCart = cartState.assets.some(
19-
(item: LibraryAsset) =>
20-
item.path === asset.path && item.isPrivate === asset.isPrivate,
21-
);
22-
23-
const handleAddToCart = async () => {
24-
actions.add(asset);
25-
};
28+
const isInCart = isAssetInCart(cartState.assets, asset);
2629

27-
const handleRemoveFromCart = async () => {
28-
actions.remove(asset);
30+
const handleClick = () => {
31+
if (isInCart) {
32+
actions.remove(asset);
33+
} else {
34+
actions.add(asset);
35+
}
2936
};
3037

3138
return (
3239
<Button
3340
variant="contained"
3441
size="small"
3542
color="primary"
36-
onClick={() => {
37-
if (isInCart) {
38-
handleRemoveFromCart();
39-
} else {
40-
handleAddToCart();
41-
}
42-
}}
43+
onClick={handleClick}
4344
>
4445
{isInCart ? 'Remove' : 'Add'}
4546
</Button>

0 commit comments

Comments
 (0)