Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
aa4ae95
Update minification logic in script configuration
amovar18 Jul 30, 2025
a71e8b6
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Aug 22, 2025
3bcec1f
Refactor: Remove Script Blocking feature and update related components
amovar18 Sep 2, 2025
f5b96d9
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Sep 3, 2025
58e5252
Remove script blocking provider.
amovar18 Sep 3, 2025
673ee54
Fix: Update incognito mode setting from 'spanning' to 'split'
amovar18 Sep 4, 2025
5587af3
Fix: Handle errors silently in setupIntervals and PRTStore, and preve…
amovar18 Sep 4, 2025
771f489
feat: Add IPTableData type and integrate it into ProbabilisticRevealT…
amovar18 Sep 4, 2025
bcf7c4c
feat: Enhance IPTableData type with highlighted properties and update…
amovar18 Sep 4, 2025
d30cca0
feat: Update unSortedData handling in ProbabilisticRevealTokens for i…
amovar18 Sep 4, 2025
a3d5bca
fix: Update row object key retrieval to use 'origin' instead of 'prtH…
amovar18 Sep 4, 2025
caec6c3
fix: Update title in Observability tab from 'Probabilistic Reveal Tok…
amovar18 Sep 4, 2025
45035fe
fix: Remove MDLTable from Observability tab for cleaner structure
amovar18 Sep 4, 2025
ee7e06e
feat: Add CirclePieChart components for PRTs and Script Blocking visu…
amovar18 Sep 4, 2025
85c50ee
fix: Adjust layout of CirclePieChart component for improved responsiv…
amovar18 Sep 4, 2025
bc43663
feat: Implement setActiveGroup action and integrate it into Tabs comp…
mayan-000 Sep 8, 2025
8b74999
feat: Add Script Blocking feature and refactor Probabilistic Reveal T…
amovar18 Sep 8, 2025
9875573
Fix tests after revert
amovar18 Sep 8, 2025
4bb70fb
Fix tests
mayan-000 Sep 8, 2025
0a743f3
fix: Remove unused properties and improve PRT metadata handling
amovar18 Sep 8, 2025
d7b597e
feat: Add Masked Domain List tab with MDLTable component to IPProtection
amovar18 Sep 8, 2025
949d84b
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
amovar18 Sep 8, 2025
66fd512
feat: Enhance PRTStore with detailed statistics tracking and update l…
amovar18 Sep 9, 2025
49f3e89
Create dummy story for stats header
mohdsayed Sep 11, 2025
722ef8e
Add stats circles
mohdsayed Sep 11, 2025
1a59f71
Create separate component for stats header
mohdsayed Sep 12, 2025
a8ff94a
Add pill toggle
mohdsayed Sep 12, 2025
434c52a
fix: Normalize hostname by removing 'www.' prefix in DataStore
amovar18 Sep 12, 2025
cf60f89
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
mohdsayed Sep 12, 2025
7a5891c
Create common component for mdl table
mohdsayed Sep 12, 2025
003639b
Add configuration for stats
mohdsayed Sep 12, 2025
2ed63e4
feat: Add statistics tracking for tokens in PRTStore and context prov…
amovar18 Sep 12, 2025
38934ec
feat: Enhance script blocking statistics tracking and update response…
amovar18 Sep 12, 2025
6b0829e
fix: Correctly aggregate token statistics in PRTStore
amovar18 Sep 12, 2025
edfb887
fix: Simplify origin extraction logic and add logging for prtHeader
amovar18 Sep 12, 2025
8f4c6d9
Fix failing test
amovar18 Sep 15, 2025
d41d6be
fix: Update Node.js setup to use version file and enable npm caching
amovar18 Sep 15, 2025
1aab77f
Sync the UI for statistics update.
amovar18 Sep 15, 2025
bb5421b
fix: Refactor MDLTable to use useScriptBlocking and remove unused tab…
amovar18 Sep 15, 2025
b162a97
Lower opacity if highlighted row is selected
mayan-000 Sep 15, 2025
0eb3029
feat: Add optional bottomPanel and showJson props to MdlCommonPanel
amovar18 Sep 15, 2025
a60fefc
feat: Enhance PRTMetadata with owner field and add filtering capabili…
amovar18 Sep 16, 2025
c12a9ca
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Sep 16, 2025
cc7fc0a
feat: Add @p5-wrapper/react with lazy loading and update build script…
amovar18 Sep 16, 2025
3ee10c9
Change the header of the signal filter.
amovar18 Sep 16, 2025
c83936d
fix: Simplify access to scriptBlocking and prtStatistics in PRTStore
amovar18 Sep 16, 2025
72a7c0e
feat: Add ProgressBar fallback to Suspense components and import Drag…
amovar18 Sep 16, 2025
87b42e0
refactor: Optimize statistics update logic in PRTStore and updateStat…
amovar18 Sep 16, 2025
660f1dc
Fix circle bottom title width
mohdsayed Sep 17, 2025
3045204
Update filters for PRTs
mohdsayed Sep 17, 2025
a72c7fc
Fix typo
mohdsayed Sep 17, 2025
5a3d90a
fix: Correct filter labels for PRTs and enhance script blocking filte…
amovar18 Sep 17, 2025
41a9128
feat: Enhance ProbabilisticRevealTokens with filter state management …
amovar18 Sep 17, 2025
7f80a50
Rename global to session
mohdsayed Sep 18, 2025
dfd3ae2
Update text for script blocking checkbox
mohdsayed Sep 18, 2025
73790a2
Update title for 'Impacted by Script Blocking' to scope
mohdsayed Sep 18, 2025
674c734
Rename titles for stats matrix
mohdsayed Sep 18, 2025
ac0ae61
Fix spacing of the header stats
mohdsayed Sep 18, 2025
89b63d7
Rename PRT stats
mohdsayed Sep 18, 2025
ee00075
Format json being shown
amovar18 Sep 19, 2025
d87315d
Add show request filter for script blocking.
amovar18 Sep 19, 2025
1e57cd7
Keep PRT hidden by default
mohdsayed Sep 22, 2025
700cf38
Add two more circles in stats header, so now it would be Domains, MDL…
mohdsayed Sep 22, 2025
4c21026
Reduce gap between circles
mohdsayed Sep 22, 2025
56e2459
Refactor header stats to center circles
mohdsayed Sep 22, 2025
3810f6f
Add MDL filtering and remove filters for the MDL common table.
amovar18 Sep 22, 2025
a1a3346
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
amovar18 Sep 22, 2025
e3defcd
Add click events to scriptBlocking stats.
amovar18 Sep 22, 2025
a7594fc
Change design for empty circle chart
amovar18 Sep 22, 2025
bbdd2ff
Change names
amovar18 Sep 22, 2025
c1fb335
Move sync storage to session storage,
amovar18 Sep 22, 2025
926a975
Add optional toop on the piechart circle
mohdsayed Sep 23, 2025
41eba32
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
amovar18 Sep 23, 2025
94be335
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
amovar18 Sep 23, 2025
e3d799a
Add tooltip text
mohdsayed Sep 23, 2025
0a54afa
Add another circle and optional chaining
amovar18 Sep 23, 2025
18d9cb0
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
mohdsayed Sep 23, 2025
dac78e3
Add tooltip to signals
mohdsayed Sep 23, 2025
7f67b43
Add tooltip to the script blocking
mohdsayed Sep 23, 2025
7a46272
Improve tooltip text
mohdsayed Sep 23, 2025
6bf86a8
Refactor MDLTable and MdlCommonPanel components; update props and rem…
amovar18 Sep 24, 2025
25c6cda
Merge branch 'develop' of github.com:GoogleChromeLabs/ps-analysis-too…
mohdsayed Sep 25, 2025
a352555
Add session insights tab
mohdsayed Sep 25, 2025
4d8a111
Remove tabs and move session data to new tabs
mohdsayed Sep 25, 2025
79cff28
Refactor code to create common component for session insights tab
mohdsayed Sep 26, 2025
dc67140
Arrage the pie chart circles
mohdsayed Sep 26, 2025
e7dc8ad
Add matrix to the insights
mohdsayed Sep 26, 2025
3b600dc
Fix typescript issue
mohdsayed Sep 26, 2025
788d264
Keep explaination open by default
mohdsayed Sep 26, 2025
86b196f
Rename file and update props.
amovar18 Sep 29, 2025
ca352d5
Add Glossary and Panel components; refactor ProbabilisticRevealTokens…
amovar18 Sep 29, 2025
611ec50
Enhance UI components: add formedJson prop to MdlCommonPanel, display…
amovar18 Sep 29, 2025
1bfd8e5
Refactor SessionInsights: update Blockings color and remove unnecessa…
amovar18 Sep 29, 2025
a557e6a
Refactor MDLTable and ProbabilisticRevealTokens: replace Panel compon…
amovar18 Sep 29, 2025
f065e34
Refactor MDLTable: update highlightedClass to a function for dynamic …
mayan-000 Sep 29, 2025
b397f2b
Refactor IPProtection and ScriptBlocking: rename titles for consisten…
amovar18 Sep 30, 2025
5d40dd5
Refactor SessionInsights and InsightsStats: update stats structure to…
amovar18 Sep 30, 2025
d0d2d13
Merge branch 'feat/merge-script-protection' of github.com:GoogleChrom…
amovar18 Sep 30, 2025
bc550f6
Refactor InsightsStats: update testId in CookiesLandingWrapper for co…
amovar18 Sep 30, 2025
722f26c
Fix getSignal function to return 'No Signal' for empty input instead …
amovar18 Sep 30, 2025
25c47fa
fix: check if group is selected before changing active tab
mayan-000 Sep 30, 2025
f2a3215
Update width of columns for PRT site table
mayan-000 Sep 30, 2025
b6d4c68
Remove leftover tooltips from circles
mohdsayed Sep 30, 2025
54508d3
Use JSON view for the tab
mohdsayed Sep 30, 2025
80799d6
Fix spacing for glossary
mohdsayed Sep 30, 2025
f2e93d2
Change glossary key name and add back glossary texts
mohdsayed Sep 30, 2025
494f902
Improve explaination a bit
mohdsayed Sep 30, 2025
f283adf
Use component instead of function for bottomPanel
mohdsayed Sep 30, 2025
b658b40
Small code improvements
mohdsayed Sep 30, 2025
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
2 changes: 1 addition & 1 deletion packages/common/src/mdl.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface MDLTableData {
owner: string;
scriptBlocking: string;
highlighted?: boolean;
highlightedClass?: string;
highlightedClass?: (selected: boolean) => string;
}
4 changes: 2 additions & 2 deletions packages/common/src/prtToken.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ interface DecryptedToken {

interface PlaintTextToken {
uint8Signal: Uint8Array<any>;
humanReadableSignal: string;
ordinal: Uint8Array<any>;
version: number;
hmacValid: boolean;
}

export interface PRTMetadata {
origin: string;
humanReadableSignal: string;
decryptionKeyAvailable: boolean;
prtHeader: string;
nonZeroUint8Signal: boolean;
owner: string;
}

export type UniquePlainTextToken = PlaintTextToken & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,27 @@ import { VictoryPie } from 'victory-pie';
* Internal dependencies
*/
import { COLOR_MAP } from '../../theme/colors';
import Tooltip from './tooltip';

const EmptyCirclePieChart = () => {
const EmptyCirclePieChart = ({
tooltipText = '',
showTooltip = false,
}: {
tooltipText?: string;
showTooltip?: boolean;
}) => {
return (
<div className="w-full h-full relative">
<VictoryPie
padding={0}
innerRadius={0}
innerRadius={175}
colorScale={[COLOR_MAP.brightGray.color]}
data={[{ x: '', y: 100 }]}
/>
<p className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center opacity-40 text-2xl leading-4 dark:text-black">
<p className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-center opacity-40 text-2xl leading-4 dark:text-bright-gray">
0
</p>
{tooltipText && showTooltip && <Tooltip tooltipText={tooltipText} />}
</div>
);
};
Expand Down
28 changes: 23 additions & 5 deletions packages/design-system/src/components/circlePieChart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
/**
* External dependencies.
*/
import React from 'react';
import React, { useState } from 'react';
import { VictoryPie } from 'victory-pie';
import classNames from 'classnames';

/**
* Internal dependencies.
*/
import EmptyCirclePieChart from './emptyCirclePieChart';
import Tooltip from './tooltip';

interface CirclePieChartProps {
centerCount: number;
Expand All @@ -32,7 +33,9 @@ interface CirclePieChartProps {
fallbackText?: string;
infoIconClassName?: string;
centerTitleExtraClasses?: string;
bottomTitleExtraClasses?: string;
pieChartExtraClasses?: string;
tooltipText?: string;
}

export const MAX_COUNT = 999;
Expand All @@ -42,15 +45,25 @@ const CirclePieChart = ({
data,
title,
centerTitleExtraClasses = '',
bottomTitleExtraClasses = '',
pieChartExtraClasses = '',
tooltipText = '',
}: CirclePieChartProps) => {
const [showTooltip, setShowTooltip] = useState(false);
const centerTitleClasses = centerCount <= MAX_COUNT ? 'text-2xl' : 'text-l';

return (
<div className="w-full h-full flex flex-col items-center justify-start">
<div className="inline-block align-bottom w-16">
<div
className="w-full h-full flex flex-col items-center justify-start"
onMouseEnter={() => setShowTooltip(true)}
onMouseLeave={() => setShowTooltip(false)}
>
<div className="inline-block align-bottom w-16 relative">
{centerCount <= 0 ? (
<EmptyCirclePieChart />
<EmptyCirclePieChart
tooltipText={tooltipText}
showTooltip={showTooltip}
/>
) : (
<div className={`w-full h-full relative ${pieChartExtraClasses}`}>
<VictoryPie
Expand All @@ -69,11 +82,16 @@ const CirclePieChart = ({
>
{centerCount <= MAX_COUNT ? centerCount : MAX_COUNT + '+'}
</p>
{tooltipText && showTooltip && (
<Tooltip tooltipText={tooltipText} />
)}
</div>
)}
</div>
{title && (
<div className="flex items-center justify-center gap-1 mt-2 relative">
<div
className={`flex items-center justify-center gap-1 mt-2 relative ${bottomTitleExtraClasses}`}
>
<p className="text-xs text-center font-semibold leading-relaxed dark:text-bright-gray">
{title}
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export const Primary: StoryObj<typeof meta> = {
color: COLOR_MAP.uncategorized.color,
},
],
tooltipText: 'This chart shows the distribution of counts.',
},
render: (args) => (
<div className="w-16">
Expand Down
29 changes: 29 additions & 0 deletions packages/design-system/src/components/circlePieChart/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* External dependencies.
*/
import React from 'react';

const Tooltip = ({ tooltipText }: { tooltipText?: string }) => {
return (
<div className="absolute left-1/2 bottom-0 translate-x-[-50%] translate-y-[110%] bg-black/80 text-white text-xs rounded px-2 py-1 shadow-lg animate-fadeIn z-10 pointer-events-none text-center max-w-xs min-w-[80px] w-max whitespace-pre-line transition-opacity duration-300">
{tooltipText}
</div>
);
};

export default Tooltip;
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,26 @@ const BodyRow = ({
const rowKey = getRowObjectKey(row);
const isHighlighted = row.originalData?.highlighted;
const scrollToHighlighted = row.originalData?.scrollToHighlighted;
const isHighlightedClass =
row.originalData?.highlightedClass || 'bg-dirty-pink dark:text-black';
const highlightedClass = (selected: boolean) =>
row.originalData?.highlightedClass?.(selected) ||
'bg-dirty-pink dark:text-black';

const classes = classnames(
rowKey !== selectedKey &&
(index % 2
? isHighlighted
? isHighlightedClass
? highlightedClass(false)
: 'bg-anti-flash-white dark:bg-charleston-green'
: isHighlighted
? isHighlightedClass
? highlightedClass(false)
: 'bg-white dark:bg-raisin-black'),
rowKey === selectedKey &&
(isRowFocused
? isHighlighted
? isHighlightedClass
? `${highlightedClass(true)}`
: 'bg-lavender-sky text-black dark:bg-midnight-slate dark:text-chinese-silver'
: isHighlighted
? isHighlightedClass
? `${highlightedClass(true)}`
: 'bg-silver-mist text-black dark:bg-dark-graphite dark:text-chinese-silver')
);
const extraClasses = getExtraClasses();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export type TableData = (
| PRTMetadata
) & {
highlighted?: boolean;
highlightedClass?: string; // Optional class for highlighting rows
highlightedClass?: () => string; // Optional class for highlighting rows
scrollToHighlighted?: boolean; // Optional flag to scroll to highlighted row
};

Expand Down
60 changes: 26 additions & 34 deletions packages/design-system/src/components/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {
activeTab,
activeGroup,
setActiveTab,
setActiveGroup,
groupedTitles,
titles,
isTabHighlighted,
shouldAddSpacer,
getTabGroup,
isGroup,
loading,
} = useTabs(({ state, actions }) => ({
activeTab: state.activeTab,
activeGroup: state.activeGroup,
setActiveTab: actions.setActiveTab,
setActiveGroup: actions.setActiveGroup,
groupedTitles: state.groupedTitles,
titles: state.titles,
isTabHighlighted: actions.isTabHighlighted,
Expand All @@ -57,18 +58,6 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {

const timeoutRef = useRef<NodeJS.Timeout | null>(null);

const [expandedGroup, setExpandedGroup] = useState<string | null>(null);

useEffect(() => {
if (loading) {
return;
}

if (activeGroup && expandedGroup === null) {
setExpandedGroup(activeGroup);
}
}, [activeGroup, expandedGroup, loading]);

useEffect(() => {
return () => {
if (timeoutRef.current) {
Expand All @@ -87,17 +76,15 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {

setIsAnimating(true);

if (expandedGroup === group) {
setExpandedGroup(null);
} else {
setExpandedGroup(group);
if (activeGroup !== group) {
setActiveGroup(group);
}

timeoutRef.current = setTimeout(() => {
setIsAnimating(false);
}, 300);
},
[expandedGroup, isAnimating]
[activeGroup, isAnimating, setActiveGroup]
);

const handleKeyDown = useCallback(
Expand All @@ -108,37 +95,36 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {
if (event.shiftKey) {
const previousIndex = activeTab - 1;
if (previousIndex >= 0) {
setActiveTab(previousIndex);

const group = getTabGroup(previousIndex);
if (expandedGroup !== group) {
console.log(group, expandedGroup);
if (activeGroup !== group) {
handleGroupClick(group);
}
} else {
setActiveTab(titles.length - 1);

setActiveTab(previousIndex);
} else {
const group = getTabGroup(titles.length - 1);
if (expandedGroup !== group) {
if (activeGroup !== group) {
handleGroupClick(group);
}

setActiveTab(titles.length - 1);
}
} else {
const nextIndex = activeTab + 1;
if (nextIndex < titles.length) {
setActiveTab(nextIndex);

const group = getTabGroup(nextIndex);
if (expandedGroup !== group) {
if (activeGroup !== group) {
handleGroupClick(group);
}
} else {
setActiveTab(0);

setActiveTab(nextIndex);
} else {
const group = getTabGroup(0);
if (expandedGroup !== group) {
if (activeGroup !== group) {
handleGroupClick(group);
}

setActiveTab(0);
}
}
}
Expand All @@ -148,7 +134,7 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {
titles.length,
setActiveTab,
getTabGroup,
expandedGroup,
activeGroup,
handleGroupClick,
]
);
Expand All @@ -171,7 +157,7 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {
)}
>
{Object.entries(groupedTitles).map(([group, data]) => {
const isExpanded = expandedGroup === group;
const isExpanded = activeGroup === group;

return (
<div
Expand Down Expand Up @@ -245,7 +231,13 @@ const Tabs = ({ showBottomBorder = true, fontSizeClass }: TabsProps) => {
)}
>
<button
onClick={() => setActiveTab(index)}
onClick={() => {
if (group !== activeGroup) {
handleGroupClick(group);
}

setActiveTab(index);
}}
onKeyDown={handleKeyDown}
className="px-1.5 hover:opacity-80 outline-none text-nowrap"
>
Expand Down
5 changes: 5 additions & 0 deletions packages/design-system/src/components/tabs/tests/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const mockUseTabs = useTabs as jest.Mock;
describe('Tabs', () => {
it('should render', () => {
const setActiveTab = jest.fn();
const setActiveGroup = jest.fn();

mockUseTabs.mockReturnValue({
activeTab: 0,
Expand All @@ -53,6 +54,7 @@ describe('Tabs', () => {
],
},
setActiveTab,
setActiveGroup,
isTabHighlighted: jest.fn((tab: number) => (tab === 0 ? 1 : 99)),
shouldAddSpacer: jest.fn(() => false),
getTabGroup: jest.fn((tab: number) =>
Expand Down Expand Up @@ -83,6 +85,7 @@ describe('Tabs', () => {

it('should handle grouped tabs', () => {
const setActiveTab = jest.fn();
const setActiveGroup = jest.fn();

mockUseTabs.mockReturnValue({
activeTab: 0,
Expand Down Expand Up @@ -111,6 +114,7 @@ describe('Tabs', () => {
],
},
setActiveTab,
setActiveGroup,
shouldAddSpacer: jest.fn(() => false),
isTabHighlighted: jest.fn(() => false),
isGroup: true,
Expand Down Expand Up @@ -157,6 +161,7 @@ describe('Tabs', () => {
],
},
setActiveTab,
setActiveGroup,
shouldAddSpacer: jest.fn(() => false),
isTabHighlighted: jest.fn(() => false),
});
Expand Down
Loading
Loading