1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-28 17:55:15 +02:00
Commit Graph

4592 Commits

Author SHA1 Message Date
Thomas Heartman
7f97121c3b
fix: fall back to count === 0 if undefined / don't show "0 of undefined" (#10687)
If the total number of flag is undefined, we've previously shown "0 of
undefined". However, I don't think that's sensible. Instead, we should
show "0".

Before:
<img width="386" height="114" alt="image"
src="https://github.com/user-attachments/assets/5da61c05-16d2-4722-9874-63c1d011884b"
/>

After:
<img width="224" height="103" alt="image"
src="https://github.com/user-attachments/assets/c6c0711b-f3ce-45e3-8302-bfe9377112a8"
/>
2025-09-25 11:26:53 +02:00
Thomas Heartman
81b643cada
chore: rename variable for clarity (#10694)
entriesToLeave is more ambiguous than entriesToKeep, so let's go with
the latter.
2025-09-25 11:17:05 +02:00
Mateusz Kwasniewski
58c0076f22
feat: display aggregation mode automatically (#10696) 2025-09-24 18:02:26 +02:00
Thomas Heartman
59bf19bf96
chore: use params object for swr cache clearing functions (#10692)
With three and four different parameters (of which two are strings that
are easily interchanged), it makes sense to rewrite these two functions
to take named parameters instead. This is a follow-up to
https://github.com/Unleash/unleash/pull/10689 based on one of the review
comments.
2025-09-24 15:17:25 +02:00
Thomas Heartman
e3fc88b11f
fix: cache eviction bug and the eternal loading screen (#10689)
Fixes an issue where the project feature list (and potentially other
places in the app that use the `useClearSWRCache` hook) would end up in
an infinite loading screen because the latest entry that we want to show
was overwritten.

The primary reason this happened is that we used `keysToDelete =
array.slice(SWR_CACHE_SIZE - 1)`. Because the map keys are returned in
insertion order, this would make us never delete the oldest keys, but
always anything after the cache reached it's maximum size. The fix was
to instead do `slice(0, -(SWR_CACHE_SIZE - 1))`, unless that is `0, 0`.
If so, then just delete the entire filtered keys set.

As a bonus: this PR also deduplicates cache entries that have the same
query params but in different order for the feature search. This further
reduces the cache space needed.
2025-09-24 14:37:58 +02:00
Nuno Góis
3d9f5581d5
chore: limit total custom strategies displayed (#10688)
https://linear.app/unleash/issue/2-3897/limit-custom-strategies-like-were-doing-with-release-templates

Limits total custom strategies displayed, like we're doing for release
templates, in the new "add strategy" modal.

Added a more generic logic to `FeatureStrategyMenuCardsSection.tsx` so
we can reuse it for both.

We can also do it for other sections in the modal, but that feels like a
premature optimization. These 2 categories are the ones that are user
owned, and can have many items.
2025-09-24 13:06:49 +01:00
Nuno Góis
e98b511bb2
chore: add quick filter for custom strategies (#10686)
https://linear.app/unleash/issue/2-3896/add-quick-filter-for-custom-strategies

Adds a quick filter for custom strategies in the new "add strategy"
modal.

<img width="793" height="234" alt="image"
src="https://github.com/user-attachments/assets/b7190ff1-ef92-44b2-ad78-f3b283bdf6a2"
/>
2025-09-24 12:29:37 +01:00
Nuno Góis
27af5cb0b9
chore: update view more templates button design (#10685)
https://linear.app/unleash/issue/2-3898/update-the-design-of-the-view-more-button

Updates the design of the "view more templates" button in the new "add
strategy" modal.

<img width="925" height="221" alt="image"
src="https://github.com/user-attachments/assets/2a790828-aac5-4c56-bbac-bcb254dc6049"
/>
2025-09-24 12:02:26 +01:00
Mateusz Kwasniewski
efdfb67c9f
feat: histogram impact metric UI (#10684) 2025-09-24 10:53:58 +02:00
Nuno Góis
b4ad9c964f
chore: adjust add strategy modal height (#10677)
https://linear.app/unleash/issue/2-3893/set-a-minimum-height-in-the-release-template-preview-dialog

Adjusts the "add strategy" and "release template preview" modal heights,
ensuring better visual consistency between them.
2025-09-23 16:25:51 +01:00
Nuno Góis
63b0006b46
chore: update strategy cards background color (#10681)
https://linear.app/unleash/issue/2-3895/update-cards-background-color

Updates the strategy cards background color to match the designs.

<img width="985" height="569" alt="image"
src="https://github.com/user-attachments/assets/6b6e1dd3-b811-4841-8858-4046f3c79717"
/>
2025-09-23 13:54:25 +01:00
Thomas Heartman
4dd97b97f4
chore: use paginated table for change request list (#10660)
Adds a paginated table to the change request overview page and
integrates it with the search API hook.

The current implementation still has some rough edges to work out, but
it's getting closer.

There's no sort buttons in this implementation. I've got it working on
the side, but TS is complaining about types not matching up, so I'm
spinning that out to a separate PR.

<img width="1808" height="1400" alt="image"
src="https://github.com/user-attachments/assets/bdee97b7-ee2a-46c0-8460-a8b8e14d3c92"
/>
2025-09-23 12:05:11 +00:00
Thomas Heartman
6be5e6c969
fix: don't call location hook conditionally in CR badge (#10676)
Fixes a bug where I added a conditional hook call in
https://github.com/Unleash/unleash/pull/10651.
2025-09-23 10:46:23 +02:00
Nuno Góis
f36b39b721
chore: update release template preview dialog (#10673)
https://linear.app/unleash/issue/2-3888/update-the-release-templates-preview-dialog-to-match-the-new-designs

Updates the release template preview dialog when using the new "add
strategy" modal, so it better matches the new design.

Used the legacy file pattern to leave the previous modal component
unchanged.

<img width="992" height="467" alt="image"
src="https://github.com/user-attachments/assets/fd000822-c987-47be-b8a4-3f137e0291ec"
/>

<img width="979" height="576" alt="image"
src="https://github.com/user-attachments/assets/02a27d5c-4480-4a49-88ae-0d573ff0f640"
/>
2025-09-22 14:55:24 +01:00
Nuno Góis
a1691fead7
chore: add new strategy icons (#10665)
https://linear.app/unleash/issue/2-3879/add-new-strategy-icons

Adds new strategy icons in the new "add strategy" modal.

<img width="983" height="564" alt="image"
src="https://github.com/user-attachments/assets/dc39379d-f8c0-41ec-9510-61b6115acfa5"
/>

<img width="988" height="565" alt="image"
src="https://github.com/user-attachments/assets/dba642f1-bf37-4e49-906d-dcd88fdaf1e0"
/>
2025-09-22 11:26:52 +01:00
Nuno Góis
2e2840e690
chore: persist strategy filter when going back from release template preview (#10663)
https://linear.app/unleash/issue/2-3878/persist-strategy-filter-when-going-back-from-the-release-template

Persists the strategy filter in the new "add strategy" modal when going
back from the release template preview modal.

This is done by moving the filter to the parent component, so the filter
state persists across these navigations.

Also updates the button text in the release templates preview to say
"Apply template" for consistency, but only if the `newStrategyModal`
flag is enabled.
2025-09-22 10:52:28 +01:00
Mateusz Kwasniewski
7d70f8fc55
fix: encode application name (#10671) 2025-09-19 11:24:17 +02:00
Thomas Heartman
a519cb84f5
Add use change request search hook for UI. (#10664)
Adds a use change request search hook. The hook (and tests) are based
closely on the `useFeatureSearch` files.

I will wire them up to the table in an upcoming PR.

Also: fixes the orval schema to use numbers for offset and limit instead
of strings (enterprise pr incoming). Plus: updates a variable usage in
the use feature search hook.
2025-09-12 12:16:58 +00:00
Nuno Góis
af0b3529b7
chore: update strategy cards in new add strategy modal (#10659)
https://linear.app/unleash/issue/2-3867/update-strategy-cards

Updates the new "add strategy" modal strategy cards.

Followed the same logic as before where I took a snapshot of existing
components and prefixed them with `Legacy`.

Does not include the new icons.

<img width="979" height="562" alt="image"
src="https://github.com/user-attachments/assets/8cb45c78-ad67-41f2-a6e2-db48fefbabdb"
/>

<img width="317" height="108" alt="image"
src="https://github.com/user-attachments/assets/fb692ebc-26ad-4331-813a-baaf56d0df7e"
/>
2025-09-12 10:14:21 +01:00
Thomas Heartman
f9267d9cb4
chore: add orval schemas for change request search (#10661)
Adds first iteration of orval charts for change request searching.
2025-09-12 08:43:22 +00:00
Thomas Heartman
c843518de4
chore: scroll to the top of table when changing page (#10657)
Makes it so that if you change the page in a paginated table, you'll
scroll to the top of the table. Makes the experience more user friendly.

Will only scroll if the top of the table isn't in view already.

Also scrolls to the top of the table when you change the page size
unless: you are on the first page **and** increasing the page size.

The reason for this behavior is:
- we already send you back to page 1 if you change the page size (so it
makes sense to also scroll you to the top)
- if you're increasing the page size because you're at the bottom of the
table, you probably wanna keep your place
- if you're decreasing the page size, you might be below where the
actual table cuts off, so you'll end up at the bottom of the table (or
below the table completely if that's possible on that page)
2025-09-12 10:40:48 +02:00
Tymoteusz Czech
e79fa33647
fix: quick project filters total calculation (#10658) 2025-09-11 16:29:04 +02:00
Tymoteusz Czech
4b42435590
feat(frontend): quick filters on project overview (#10638) 2025-09-11 13:28:59 +02:00
Nuno Góis
be4665f3f1
chore: update release templates empty states in new add strategy modal (#10656)
https://linear.app/unleash/issue/2-3876/update-the-release-templates-section-accordingly

Updates the release templates empty states in the new add strategy modal
to match the new design sketches.

Also fixes a few details in the modal base design.

<img width="989" height="583" alt="image"
src="https://github.com/user-attachments/assets/b3148fe1-eb61-48d5-84cb-3dc4381f7c0c"
/>

<img width="981" height="581" alt="image"
src="https://github.com/user-attachments/assets/54f9a4d7-8cde-4f4b-bc9d-dc7114d7e17f"
/>
2025-09-11 11:19:55 +01:00
Nuno Góis
c0eedba400
chore: small updates to the new add strategy modal design (#10646)
https://linear.app/unleash/issue/2-3877/small-changes-to-match-the-new-designs

This adds 2 changes in our new "add strategy" modal to better align with
our sketches:
- Remove the "Custom strategies" filter: According to the designs,
they're part of the "Advanced strategies" filter;
- Update the project default tooltip in case you don't have access to
the project default strategy configuration;

Here are the design references:

<img width="330" height="148" alt="image"
src="https://github.com/user-attachments/assets/c508e776-5f54-4402-b148-321ea99e1134"
/>

<img width="657" height="371" alt="image"
src="https://github.com/user-attachments/assets/c9d8be22-99a3-46e3-b7a7-a77b94e0aa60"
/>

And this is how it looks like after this PR:

<img width="335" height="116" alt="image"
src="https://github.com/user-attachments/assets/f1e0cbec-d79a-49b6-a8a7-1b15f3f2726e"
/>

<img width="984" height="401" alt="image"
src="https://github.com/user-attachments/assets/7271ab5c-721e-4624-aebe-d3c5d7e402dd"
/>
2025-09-11 10:50:16 +01:00
Thomas Heartman
fabf76e12c
feat: global change requests table (#10650)
Adds basic table layout for the global change requests page and makes
the page accessible at `/change-requests`.

The table is based on the project-based change request table, but with a
slightly different set of columns.

Uses mock data for now. 

There's still some styling to be done for the column widths and handling
narrower screens.

<img width="1386" height="671" alt="image"
src="https://github.com/user-attachments/assets/b24ed625-d3f6-4281-ba44-30744d5063f3"
/>

If the flag is disabled, we render nothing useful.
<img width="1429" height="287" alt="image"
src="https://github.com/user-attachments/assets/289b5707-4389-4c08-bf68-55d63e186ba5"
/>


closes 1-4076
2025-09-11 10:15:57 +03:00
Thomas Heartman
d3e7e67b91
Fix: use locale string for change request time badge. (#10651)
Uses the user's preferred date / time formatting for the scheduled at
time in CR schedule badges.

Before (en-US formatting):
<img width="291" height="58" alt="image"
src="https://github.com/user-attachments/assets/edb04292-4678-4bfd-93a1-8fd2a3f01a1f"
/>

After (ja formatting):
<img width="308" height="106" alt="image"
src="https://github.com/user-attachments/assets/9828355f-0c23-4b8f-bef3-a0173e92c306"
/>
2025-09-11 09:13:26 +02:00
Thomas Heartman
aec3461159
chore: change from "change requests" to "open" in project change request tabs (#10648)
For some reason, the two change request tabs are called "Change
Requests" and "Closed", instead of "Open" and "Closed".

I suspect this may be an error, but this fixes it. 

Before:
<img width="383" height="176" alt="image"
src="https://github.com/user-attachments/assets/faf95827-f384-4187-bc0b-f32b8fbbef41"
/>

After:
<img width="372" height="166" alt="image"
src="https://github.com/user-attachments/assets/67528024-7783-42e3-b014-bad4f7bc871b"
/>
2025-09-10 16:05:22 +02:00
Thomas Heartman
509dd80f86
chore: Update from "toggles" to "flags" (#10647)
Updates the features cell text when you have lots of flags affected.

Looks like we missed this one in a previous renaming attempt.

Before:
<img width="245" height="154" alt="image"
src="https://github.com/user-attachments/assets/922334f4-a0f1-4dee-9d14-3c9b3f77f32c"
/>

After:
<img width="275" height="170" alt="image"
src="https://github.com/user-attachments/assets/7fa0f454-e695-46aa-918b-c22b97e94187"
/>
2025-09-10 16:05:18 +02:00
Nuno Góis
a5adac5d8d
chore: add quick filters to add strategy modal (#10641)
https://linear.app/unleash/issue/2-3868/add-strategy-filters-at-the-top

Adds quick filters to our "add strategy" modal.

`FeatureStrategyMenuCards.tsx` was getting increasingly complex, so this
includes some refactoring.

My quick filters implementation was generic enough that I added
`QuickFilters.tsx` as a common component, maybe we can reuse it in the
future.

<img width="991" height="663" alt="image"
src="https://github.com/user-attachments/assets/352b6d2d-c975-4cb1-9799-163dfb153ccb"
/>

<img width="985" height="358" alt="image"
src="https://github.com/user-attachments/assets/a7d20dab-2774-409f-8940-f0d1a980b819"
/>
2025-09-10 12:14:14 +01:00
Thomas Heartman
0ea006f72c
Add globalChangeRequestList flag to Unleash (#10645)
Add a flag for the new CR list feature.
2025-09-10 11:11:10 +00:00
Mateusz Kwasniewski
b55a961da0
refactor: centralize pagination options (#10636) 2025-09-09 14:00:55 +02:00
Mateusz Kwasniewski
6198900014
fix: limit reset when no pagination bar (#10634) 2025-09-09 13:18:33 +02:00
Nuno Góis
2cd8135988
chore: new add strategy modal design (#10633)
https://linear.app/unleash/issue/2-3870/new-modal-design

New "add strategy" modal base design.

We're still missing a few details, like the new card design and the
filters at the top, but those will come in follow-up PRs.

### New layout

<img width="986" height="597" alt="image"
src="https://github.com/user-attachments/assets/2bc83117-97a8-4b59-a187-73ef9a7d0469"
/>

### Default strategy tooltip, with a link to the default strategy
settings

<img width="326" height="119" alt="image"
src="https://github.com/user-attachments/assets/45da60cb-088b-4b6e-bead-f9ef13a2540b"
/>

### Default strategy with a custom title

<img width="318" height="163" alt="image"
src="https://github.com/user-attachments/assets/9c9862db-f21d-409f-8dc1-63673f00ba2e"
/>
2025-09-09 10:57:06 +01:00
Tymoteusz Czech
edaea80f0c
refactor: new endpoint for global impact metrics saving (#10631)
Use `impact-metrics/config` for saving global charts.
2025-09-09 09:22:43 +02:00
Nuno Góis
b8cdd1d004
chore: add newStrategyModal flag (#10629)
https://linear.app/unleash/issue/2-3865/add-newstrategymodal-feature-flag

Adds `newStrategyModal` feature flag.

The approach here is to duplicate the existing
`FeatureStrategyMenuCards` into a `LegacyFeatureStrategyMenuCards`.
We'll continue working on the `FeatureStrategyMenuCards` component while
leaving `LegacyFeatureStrategyMenuCards` untouched. Once we're done with
the implementation and remove the flag we can drop the legacy file.

I think it's easier to reduce our add strategy buttons to a single one
right away (like we did with the `addConfiguration` flag in
https://github.com/Unleash/unleash/pull/10420). This allows us to focus
on the end result instead of having to implement things like "clicking
the 'add release template' button should show the modal filtered to only
release templates".

<img width="735" height="126" alt="image"
src="https://github.com/user-attachments/assets/6d10fab2-d091-40f3-9c36-05a6f28f7dda"
/>

<img width="995" height="742" alt="image"
src="https://github.com/user-attachments/assets/a0fb9366-89b5-44e1-a684-47ee30d6d36c"
/>
2025-09-08 12:16:27 +01:00
unleash-bot[bot]
9540ed6e3d
chore(AI): addConfiguration flag cleanup (#10628)
This PR cleans up the addConfiguration flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10627

## 🧹 AI Flag Cleanup Summary
This change removes the `addConfiguration` feature flag. The feature was
discarded, so this cleanup reverts the UI to its state before the
`addConfiguration` flag was introduced. The primary change is in the
strategy
menu, where the single "Add configuration" button is removed and the
original
"Use template," "Add strategy," and "More" buttons are restored.
### 🚮 Removed
- **Flag Definitions**
- `addConfiguration` flag from `experimental.ts` on the backend.
- `addConfiguration` flag from `uiConfig.ts` on the frontend.
- `addConfiguration: true` from the `server-dev.ts` config.
- **UI Components & Logic**
- The conditional rendering in `FeatureStrategyMenu.tsx` that showed an
"Add
configuration" button.
- The `useUiFlag('addConfiguration')` hook call and its import from
`FeatureStrategyMenu.tsx`.
### 🛠 Kept
- **UI Components & Logic**
- The original set of buttons in `FeatureStrategyMenu.tsx`: "Use
template",
"Add strategy", and a "More strategies" icon button. This was the code
path for
when the flag was disabled.
### 📝 Why
The `addConfiguration` feature flag was marked as completed with the
outcome
"discarded". This cleanup removes the flag and all related code,
preserving only
the intended code path, which is the UI behavior from before the flag
was
introduced.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2025-09-08 07:38:10 -03:00
Tymoteusz Czech
ea4c0a0941
feat: handle global impact metrics in frontend api hook (#10626) 2025-09-05 10:24:48 +00:00
Tymoteusz Czech
82c79a8216
feat: add borders and spacing to feature impact metrics (#10625) 2025-09-05 10:10:25 +00:00
Mateusz Kwasniewski
33d898f684
feat: change flag impact metrics url structure (#10624) 2025-09-05 11:28:35 +02:00
Tymoteusz Czech
29dc6c746d
feat: split impact metrics label filter into sections (#10623) 2025-09-05 09:26:23 +02:00
Mateusz Kwasniewski
4e4950adb7
feat: grid layout for flag impact metrics (#10619) 2025-09-04 15:09:49 +02:00
Mateusz Kwasniewski
4a00792f1e
feat: rename impact metrics fields to match prometheus and grafana (#10616) 2025-09-04 11:51:29 +02:00
Tymoteusz Czech
e96f981816
refactor: LabelFilterItem "select all" functionality (#10610) 2025-09-04 10:03:21 +02:00
Mateusz Kwasniewski
3b1592b329
feat: flag impact metrics use update feature permission (#10615) 2025-09-04 09:58:45 +02:00
Mateusz Kwasniewski
f8990a40ba
feat: edit impact metrics (#10614) 2025-09-03 16:55:34 +02:00
Mateusz Kwasniewski
cc8a950348
feat: delete flag impact metrics (#10613) 2025-09-03 15:58:39 +02:00
Thomas Heartman
295a3abd59
fix: Only show "not enough data" text when there isn't enough data. (#10604)
The previous implementation had a small bug where it would show "not
enough data" even if the graph was loading. This commit fixes that.

While working, I thought that maybe we should keep the current data
while we're fetching new data instead of adding a cover, but all the
other graphs use a cover when loading, so I've not made any changes to
that effect.
2025-09-03 12:23:36 +02:00
Nuno Góis
fb40bb07c4
chore: slight update to unknown flags alert text (#10602)
https://linear.app/unleash/issue/2-3850/update-unknown-flag-alert

Small update to the unknown flags alert text.

<img width="994" height="776" alt="image"
src="https://github.com/user-attachments/assets/a69cdc63-b0f8-4b1b-9323-7cfdb4ba5b31"
/>
2025-09-03 10:17:17 +01:00
Thomas Heartman
778eaa9873
chore: Add a cover for when we don't have enough data to show the chart (#10599)
Adds a cover to the archived vs created flag chart if we don't have
enough data or if the data is loading. Follows the pattern established
in the other analytics charts.

Because the values for a placeholder bar chart are different than for a
placeholder line chart, I've added in actual placeholder values. This
also makes the gives the chart in question two bars per category, even
in the placeholder data, which matches nicely with the actual graph.

Before:
<img width="2272" height="974" alt="image"
src="https://github.com/user-attachments/assets/3336717f-acc8-4d23-a208-138259d6d3c7"
/>


After: 
<img width="1131" height="487" alt="image"
src="https://github.com/user-attachments/assets/5189e323-c636-4089-b4eb-30b231b09b8b"
/>

In context with the other charts: 
<img width="1392" height="1744" alt="image"
src="https://github.com/user-attachments/assets/7809669c-dae8-496b-b89b-0913fab85c17"
/>
2025-09-03 09:02:10 +02:00