Skip to content

Conversation

HYDRO2070
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Mar 16, 2025

@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.

Copy link

vercel bot commented Mar 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clearsky-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2025 9:27am

Copy link
Collaborator

@noahm noahm left a comment

Choose a reason for hiding this comment

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

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.

@HYDRO2070
Copy link
Contributor Author

HYDRO2070 commented Apr 14, 2025

@noahm Done with the changes here. Please review it. (Name of the Variable are a bit long. I did it for Understanding Purpose.)
@thieflord06

Copy link
Collaborator

@noahm noahm left a comment

Choose a reason for hiding this comment

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

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.

@HYDRO2070
Copy link
Contributor Author

@noahm @thieflord06
Done.

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 <[email protected]>
Copy link
Collaborator

@noahm noahm left a comment

Choose a reason for hiding this comment

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

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!

@thieflord06
Copy link
Member

From testing it looks like the counts aren't behaving correctly when not enabled.

lists-blocking-count
blocked-by-count
blocking-count
lists-on-count
lists-blocked-by-count
lists-on-list-counts
starter-packs-in-count
labels-count

Labels-count is the only one I've been able to confirm is working as expected.

@thieflord06
Copy link
Member

@HYDRO2070 Any update on this?

@HYDRO2070
Copy link
Contributor Author

Done with the changes. Please check @thieflord06 @noahm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Most components and API hooks now respect feature flags for conditional data fetching and UI rendering.

  • Integrated useFeatureFlag in 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 shouldFetchstarterPacksMadeCount has inconsistent camelCase; consider shouldFetchStarterPacksMadeCount for readability.
  const shouldFetchstarterPacksMadeCount = useFeatureFlag('starter-packs-made-count');

src/api/placement.js:12

  • [nitpick] Parameter shoulduserPlacement should 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 = 

// const [handleHistoryExpanded, setHandleHistoryExpanded] = useState(false);
const resolved = useAccountResolver();
const handleHistoryQuery = useHandleHistory(resolved.data?.shortDID);
const handleHistoryQuery = useHandleHistory(resolved.data?.shortDID,true);
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

[nitpick] This unconditionally fetches handle history. It would be better to gate it behind a feature flag (as in AccountExtraInfo) instead of passing true directly.

Suggested change
const handleHistoryQuery = useHandleHistory(resolved.data?.shortDID,true);
const shouldFetchHandleHistory = useFeatureFlag('handle-history');
const handleHistoryQuery = useHandleHistory(resolved.data?.shortDID, shouldFetchHandleHistory);

Copilot uses AI. Check for mistakes.

const did = accountQuery.data?.shortDID;
const { data: labelers, isLoading: isLoadingLabelers } = useLabelers();

// this hook will be called to featch all the label
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

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

[nitpick] Typo in comment: featch should be fetch.

Suggested change
// this hook will be called to featch all the label
// this hook will be called to fetch all the label

Copilot uses AI. Check for mistakes.

@thieflord06 thieflord06 enabled auto-merge July 3, 2025 16:43
Copy link
Collaborator

@noahm noahm left a comment

Choose a reason for hiding this comment

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

These look like a good way to handle the conditional display of the totals

@thieflord06 thieflord06 requested a review from Copilot September 19, 2025 15:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 26 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const statsPage = useFeatureFlag('stats-page');
const topBlocked = useFeatureFlag('top-blocked');
const topBlockers = useFeatureFlag('top-blockers');
const totalUsersWheel = useFeatureFlag('total-users-wheel')
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing semicolon at end of statement. Add semicolon for consistency with other variable declarations.

Suggested change
const totalUsersWheel = useFeatureFlag('total-users-wheel')
const totalUsersWheel = useFeatureFlag('total-users-wheel');

Copilot uses AI. Check for mistakes.

const shouldFetchstarterPacksMadeCount = useFeatureFlag('starter-packs-made-count');
const { data: totalData, isLoading: isLoadingTotal } =
usePacksCreatedTotal(shortHandle);
usePacksCreatedTotal(shortHandle,shouldFetchstarterPacksMadeCount);
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function arguments. Add space after comma for consistency with code style.

Suggested change
usePacksCreatedTotal(shortHandle,shouldFetchstarterPacksMadeCount);
usePacksCreatedTotal(shortHandle, shouldFetchstarterPacksMadeCount);

Copilot uses AI. Check for mistakes.

Comment on lines +27 to +28
const shouldFetchstarterPacksInCount =
useFeatureFlag('starter-packs-in-count');
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Variable declaration should be on a single line. Move the useFeatureFlag call to the same line as the variable declaration.

Suggested change
const shouldFetchstarterPacksInCount =
useFeatureFlag('starter-packs-in-count');
const shouldFetchstarterPacksInCount = useFeatureFlag('starter-packs-in-count');

Copilot uses AI. Check for mistakes.

useFeatureFlag('starter-packs-in-count');
const { data: totalData, isLoading: isLoadingTotal } =
usePacksPopulatedTotal(shortHandle);
usePacksPopulatedTotal(shortHandle,shouldFetchstarterPacksInCount);
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function arguments. Add space after comma for consistency with code style.

Suggested change
usePacksPopulatedTotal(shortHandle,shouldFetchstarterPacksInCount);
usePacksPopulatedTotal(shortHandle, shouldFetchstarterPacksInCount);

Copilot uses AI. Check for mistakes.

const shortHandle = accountQuery.data?.shortHandle;
const { data, fetchNextPage, hasNextPage, isLoading, isFetching } =
useList(shortHandle);
const shouldFetchListCounts = useFeatureFlag('lists-on-list-counts')
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing semicolon at end of statement. Add semicolon for consistency with other variable declarations.

Suggested change
const shouldFetchListCounts = useFeatureFlag('lists-on-list-counts')
const shouldFetchListCounts = useFeatureFlag('lists-on-list-counts');

Copilot uses AI. Check for mistakes.

* @param {Boolean | undefined} shouldIshandleHistory
*/
export function useHandleHistory(shortDid) {
export function useHandleHistory(shortDid,shouldIshandleHistory) {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function parameters. Add space after comma for consistency with code style.

Suggested change
export function useHandleHistory(shortDid,shouldIshandleHistory) {
export function useHandleHistory(shortDid, shouldIshandleHistory) {

Copilot uses AI. Check for mistakes.

* @param {Boolean | undefined} shouldFetchBlockingCount
*/
export function useBlocklistCount(did) {
export function useBlocklistCount(did,shouldFetchBlockingCount) {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function parameters. Add space after comma for consistency with code style.

Suggested change
export function useBlocklistCount(did,shouldFetchBlockingCount) {
export function useBlocklistCount(did, shouldFetchBlockingCount) {

Copilot uses AI. Check for mistakes.

* @param {Boolean | undefined} shouldFetchBlockedbyCount
*/
export function useSingleBlocklistCount(did) {
export function useSingleBlocklistCount(did,shouldFetchBlockedbyCount) {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function parameters. Add space after comma for consistency with code style.

Suggested change
export function useSingleBlocklistCount(did,shouldFetchBlockedbyCount) {
export function useSingleBlocklistCount(did, shouldFetchBlockedbyCount) {

Copilot uses AI. Check for mistakes.

* @param {Boolean | undefined} shouldFetchlistsBlockingCount
*/
export function useBlockingListsTotal(handleOrDID) {
export function useBlockingListsTotal(handleOrDID,shouldFetchlistsBlockingCount) {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function parameters. Add space after comma for consistency with code style.

Suggested change
export function useBlockingListsTotal(handleOrDID,shouldFetchlistsBlockingCount) {
export function useBlockingListsTotal(handleOrDID, shouldFetchlistsBlockingCount) {

Copilot uses AI. Check for mistakes.

* @param {Boolean | undefined} shouldFetchlistsBlockedByCount
*/
export function useBlockedByListsTotal(handleOrDID) {
export function useBlockedByListsTotal(handleOrDID,shouldFetchlistsBlockedByCount) {
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Missing space after comma in function parameters. Add space after comma for consistency with code style.

Suggested change
export function useBlockedByListsTotal(handleOrDID,shouldFetchlistsBlockedByCount) {
export function useBlockedByListsTotal(handleOrDID, shouldFetchlistsBlockedByCount) {

Copilot uses AI. Check for mistakes.

@thieflord06
Copy link
Member

@HYDRO2070 any update on this?

@thieflord06
Copy link
Member

handle-history and lists-on-list-counts is not working as expected @HYDRO2070

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.

3 participants