All Feature's using Feature Flag Hook#324
Conversation
|
@HYDRO2070 is attempting to deploy a commit to the thieflord06's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
noahm
left a comment
There was a problem hiding this comment.
the majority of these flags are associated with specific queries the app makes, but as coded here, a disabled flag does not prevent the app from making the query. this defeats the whole point of having the flags in the first place.
|
@noahm Done with the changes here. Please review it. (Name of the Variable are a bit long. I did it for Understanding Purpose.) |
noahm
left a comment
There was a problem hiding this comment.
This looks much better now. Very close to ready. There's one api call that got overlooked from last time, and two new places where you're now conditionally calling a hook. they should use the same pattern as the others where you can pass an enabled or skip parameter.
|
@noahm @thieflord06 Regarding the label count: the API is fetching all the labels, not just calling it for the count. If we were to stop that call, the labels wouldn't be fetched at all—which we don’t want. |
Signed-off-by: Shashank pandey <126805929+HYDRO2070@users.noreply.github.com>
noahm
left a comment
There was a problem hiding this comment.
You're totally right about the labels count, my apologies. (Seems like a completely pointless flag for us to have in that case) This looks good to go now!
|
From testing it looks like the counts aren't behaving correctly when not enabled. lists-blocking-count Labels-count is the only one I've been able to confirm is working as expected. |
|
@HYDRO2070 Any update on this? |
|
Done with the changes. Please check @thieflord06 @noahm |
There was a problem hiding this comment.
Pull Request Overview
Most components and API hooks now respect feature flags for conditional data fetching and UI rendering.
- Integrated
useFeatureFlagin UI components to toggle stats, packs, lists, block panels, and account info features - Extended API hooks to accept feature-flag “enabled” parameters for conditional queries
- Removed legacy commented checks and streamlined conditional rendering
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/landing/home-stats/home-stats-main.jsx | Added feature flag for total-users-wheel |
| src/detail-panels/packs/packs.jsx | Wrapped total count in useFeatureFlag guard |
| src/detail-panels/packs/packed.jsx | Introduced flag to control packs-in-count queries |
| src/detail-panels/lists/lists.jsx | Guarded list-count API and UI with feature flag |
| src/detail-panels/lists/list-view.jsx | Passed spam overlay flag to ListViewEntry |
| src/detail-panels/labeled/index.jsx | Wrapped labels-count header in feature-flag check |
| src/detail-panels/blocking/index.jsx | Conditional blocking count fetch and header |
| src/detail-panels/blocking-lists/blocking-lists-index.jsx | Feature-flag-guarded blocking-lists total |
| src/detail-panels/blocked-by/index.jsx | Guarded single block-by count with feature flag |
| src/detail-panels/blocked-by-lists/blocked-by-lists-index.jsx | Wrapped blocked-by-lists total in feature flag |
| src/detail-panels/block-panel-generic/block-panel-generic.jsx | Minor whitespace changes |
| src/detail-panels/account-header/account-header.jsx | Added flags for handle history and placement |
| src/detail-panels/account-header/account-extra-info.jsx | Wrapped description and handle history in flags |
| src/api/placement.js | Added shoulduserPlacement param to usePlacement |
| src/api/packs.js | Hook signatures updated for starter-packs totals |
| src/api/lists.js | Hook signature updated for list counts |
| src/api/handle-history.js | Hook signature updated for handle history |
| src/api/blocklist.js | Hook signatures updated for various blocklist totals |
Comments suppressed due to low confidence (3)
src/detail-panels/packs/packs.jsx:27
- [nitpick] The variable name
shouldFetchstarterPacksMadeCounthas inconsistent camelCase; considershouldFetchStarterPacksMadeCountfor readability.
const shouldFetchstarterPacksMadeCount = useFeatureFlag('starter-packs-made-count');
src/api/placement.js:12
- [nitpick] Parameter
shoulduserPlacementshould follow camelCase (shouldUserPlacement) to align with conventions.
export function usePlacement(handleOrDID,shoulduserPlacement) {
src/detail-panels/packs/packed.jsx:27
- This assignment is split across two lines and will cause a syntax error. Combine into one statement, e.g.:
const shouldFetchStarterPacksInCount = useFeatureFlag('starter-packs-in-count');
const shouldFetchstarterPacksInCount =
|
handle-history and lists-on-list-counts is not working as expected @HYDRO2070 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| header={({ count }) => (shouldFetchBlockingCount ? (<> | ||
| {localise( | ||
| `Blocking ${totalQuery.isLoading ? 'loading...' : count.toLocaleString() | ||
| }`, | ||
| { | ||
| uk: `Блокує ${totalQuery.isLoading ? 'loading...' : count.toLocaleString() | ||
| }`, | ||
| } | ||
| )} | ||
| </> | ||
| } | ||
| )} | ||
| </>) : null |
There was a problem hiding this comment.
Inconsistent formatting: missing space after opening parenthesis and before closing parenthesis. The pattern should be consistent with other similar conditionals in the file, either shouldFetchBlockingCount ? (...) : null or add consistent spacing.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin <jburton6@aum.edu>
|
Total list of the scope of this ticket: blocking-count Lists-on-count is currently associated with the counts of the lists, this needs to be changed to lists-on-list-counts and lists-on-count needs to be for the main total count on the lists tab. Also, restricted-lists-on-count needs to be renamed to restricted-lists-on-list-count. |
|
Starting ... |
No description provided.