Skip to content

feat(in-app-analytics): New rule hit table + Filters bar + data fetching - #1150

Merged
siiick merged 12 commits into
mainfrom
feat/in-app-analytics-get-query
Oct 13, 2025
Merged

feat(in-app-analytics): New rule hit table + Filters bar + data fetching#1150
siiick merged 12 commits into
mainfrom
feat/in-app-analytics-get-query

Conversation

@siiick

@siiick siiick commented Oct 1, 2025

Copy link
Copy Markdown
Contributor
  • refactor: move the data fetching in a query
  • feat: use new DS FiltersBar component
  • feat: add the new rulehit data table

@siiick
siiick force-pushed the feat/in-app-analytics-get-query branch 6 times, most recently from 7f7855b to b8b9b5f Compare October 10, 2025 15:17
@siiick
siiick force-pushed the feat/in-app-analytics-get-query branch from b8b9b5f to 9a7184a Compare October 10, 2025 16:01
@siiick
siiick force-pushed the feat/in-app-analytics-get-query branch from 9a7184a to 0446975 Compare October 10, 2025 16:05
@siiick
siiick requested a review from ChibiBlasphem October 10, 2025 16:10
@siiick
siiick marked this pull request as ready for review October 10, 2025 16:11
@siiick siiick changed the title feat(in-app-analytics): Filters bar + data fetching feat(in-app-analytics): New rule hit table + Filters bar + data fetching Oct 10, 2025
@siiick
siiick requested a review from a team October 10, 2025 16:17

@Pascal-Delange Pascal-Delange left a comment

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.

As far as I was able to judge the react code, this looks ok to me. I left some minor comments, that may be addressed in a further PR. Let's have a look at the functional QA once it's in staging.
@ChibiBlasphem can have a look at the PR tomorrow perhaps.

"decisions.tooltip.monthly": "mois de {{date}}",
"decisions.tooltip.weekly": "semaine du {{date}} <Br/>(Semaine {{weekNumber}})",
"filters.add_compare_period": "Ajouter une période de comparaison"
"filters.add_compare_period": "Ajouter une période de comparaison",

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.

We'll do a full review of translations, but at the end of the project I think (so this cycle)


const handleExportCsv = () => {
if (!currentDataGroup) return;
const rows = percentage ? currentDataGroup.data.ratio : currentDataGroup.data.absolute;

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.

To make it simpler, I'd rather we just return the csv with total values, in every case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

className="text-s w-full truncate px-4 font-medium text-purple-65"
colSpan={table.getHeaderGroups()[0]?.headers.length ?? 5}
>
See more +

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.

translation to add

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

};
}
} catch {
// ignore malformed q

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.

for convenience, add a console log ? (this is client side or server side ?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will change it in another PR (work todo on this part)

decline: '#E99B8E',
};

export const analyticsQuery = z.object({

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.

For the graph "1" especially, the backend will now also accept a timezone string, to take into account to group decisions by time bucket.

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.

(let's do that in a follow-up PR however)

if (currentParams.scenarioId !== nextParams.scenarioId) return true;
const keys = ['q'] as const;
return keys.some((k) => currentUrl.searchParams.get(k) !== nextUrl.searchParams.get(k));
export function shouldRevalidate() {

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 assume this is a remix thing ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it is. Since we load all dynamic data through queries and invalidate them programmatically when we update the URL query parameters, we want Remix to avoid revalidating the route data.

{
type: 'select',
name: 'scenario',
placeholder: 'Select scenario',

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.

even if it's annoying, let's have some translations here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@siiick
siiick merged commit 7f89825 into main Oct 13, 2025
5 checks passed
@siiick
siiick deleted the feat/in-app-analytics-get-query branch October 13, 2025 12:02
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.

2 participants