Skip to content

Commit cbb4704

Browse files
committed
feat(server): store full CSS properties in ProcessedPointedDOMElement
- Modified getRelevantStyles() to return all computed styles instead of filtering to 5 properties - Updated test mocks to reflect full CSS data in cssProperties - Enables full CSS details without re-pointing, with server-side filtering on MCP tool calls
1 parent b5b1d29 commit cbb4704

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/server/src/__tests__/utils/element-detail.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ function createMockProcessedElement(): ProcessedPointedDOMElement {
2424
fontSize: '16px',
2525
color: 'rgb(0, 0, 0)',
2626
backgroundColor: 'rgb(255, 255, 255)',
27+
marginTop: '10px',
28+
paddingLeft: '5px',
2729
},
2830
cssComputed: {
2931
display: 'block',

packages/server/src/services/element-processor.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,7 @@ export default class ElementProcessor {
6767
private getRelevantStyles(styles?: Record<string, string>): CSSProperties | undefined {
6868
if (!styles) return undefined;
6969

70-
return {
71-
display: safeGet(styles, 'display', 'block'),
72-
position: safeGet(styles, 'position', 'static'),
73-
fontSize: safeGet(styles, 'font-size', '16px'),
74-
color: safeGet(styles, 'color', 'black'),
75-
backgroundColor: safeGet(styles, 'background-color', 'transparent'),
76-
};
70+
return { ...styles };
7771
}
7872

7973
private getComponentInfo(reactFiber?: any): ComponentInfo | undefined {

0 commit comments

Comments
 (0)