Skip to content

✨ [FFL-2858] Feature Flags tab — catalog browsing (stacked PR 2 of 3) - #4916

Open
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2858
Open

✨ [FFL-2858] Feature Flags tab — catalog browsing (stacked PR 2 of 3)#4916
kellyw1806 wants to merge 1 commit into
mainfrom
kelly.wang/ffl-2858

Conversation

@kellyw1806

@kellyw1806 kellyw1806 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

Stacked on #4913 (OAuth). With the sign in functionality, this PR helps include the fetch for the total feature-flag catalog. Users are now able to browse their feature-flag catalog. It does not involve overriding flags as that is the next PR (#4912).

Stack (review bottom-up)

PR Base What it adds
1 of 3 #4913 · FFL-2597 main OAuth sign-in
2 of 3 #4916 (this) · FFL-2858 ffl-2597 catalog browsing
3 of 3 #4912 · FFL-2596 ffl-2858 flag overrides

⚠️ Base is kelly.wang/ffl-2597, not main — merge #4913 first. This PR's diff is only the catalog layer.

Changes

  • Fetches the catalog via the OAuth-capable GET /api/ui/ffe/feature-flags endpoint (paginated), transparently refreshing the token (getValidAccessToken, added here).
  • Parses/maps flags + variants (defensive value parsing, dedupe-by-key), with search + type/tag filters and pagination.
  • Expands the flags tab to render the catalog.

Demo

This is what the three PRs look like working together:

Screen.Recording.2026-07-24.at.5.14.31.PM.mov

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change (oauth.spec.tsgetValidAccessToken; flagCatalog.spec.ts).
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 180.54 KiB 180.54 KiB 0 B 0.00%
Rum Profiler 8.43 KiB 8.43 KiB 0 B 0.00%
Rum Recorder 21.12 KiB 21.12 KiB 0 B 0.00%
Logs 57.05 KiB 57.05 KiB 0 B 0.00%
Rum Salesforce N/A 138.42 KiB N/A N/A N/A
Rum Slim 138.41 KiB 138.41 KiB 0 B 0.00%
Worker 22.96 KiB 22.96 KiB 0 B 0.00%
Rum Shopify N/A 200.11 KiB N/A N/A N/A
Rum-shopify Profiler N/A 8.43 KiB N/A N/A N/A
Rum-shopify Recorder N/A 3.72 KiB N/A N/A N/A

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 27, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 76.56%
Overall Coverage: 77.17% (+0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4dcadc8 | Docs | Datadog PR Page | Give us feedback!

Comment thread developer-extension/src/panel/hooks/useSdkInfos.ts Outdated
Comment thread developer-extension/src/panel/hooks/useSdkInfos.ts
Comment thread developer-extension/package.json Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/oauth.spec.ts Outdated
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch 3 times, most recently from 84c903a to ba2f761 Compare July 27, 2026 19:19
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4d4f152 to 415b54b Compare July 27, 2026 19:28
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from ba2f761 to 5683248 Compare July 27, 2026 19:28
@kellyw1806
kellyw1806 marked this pull request as ready for review July 27, 2026 20:07
@kellyw1806
kellyw1806 requested a review from a team as a code owner July 27, 2026 20:07
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 415b54b to 4a0a996 Compare July 27, 2026 20:30
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 5683248 to 4af8227 Compare July 27, 2026 20:30
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4a0a996 to de6b4ea Compare July 27, 2026 20:40
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 4af8227 to 7376fbf Compare July 27, 2026 20:40
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from de6b4ea to 9b5a9f3 Compare July 27, 2026 20:54
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 7376fbf to fb4faa6 Compare July 27, 2026 20:54
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@sbarrio
sbarrio requested a review from bdibon July 28, 2026 07:06
@BeltranBulbarellaDD

Copy link
Copy Markdown
Contributor

@kellyw1806 In my opinion I would keep the stacked PR 2 and 3 in draft until the first one is approved. That way after changes are requested in the first one, this one remains clean for the reviewer.

@kellyw1806
kellyw1806 marked this pull request as draft July 28, 2026 13:39
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 9b5a9f3 to 6d5a341 Compare July 28, 2026 15:32
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from fb4faa6 to 230ae07 Compare July 28, 2026 15:32
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 6d5a341 to 4596d8b Compare July 28, 2026 16:29
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 230ae07 to 673a2b1 Compare July 28, 2026 16:29
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 4596d8b to a2d74a1 Compare July 28, 2026 17:19
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 673a2b1 to 2f033a5 Compare July 28, 2026 17:19
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from a2d74a1 to 59a5aa6 Compare July 28, 2026 17:39
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 2f033a5 to 98058ac Compare July 28, 2026 17:39
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 59a5aa6 to dbf0fe9 Compare July 28, 2026 18:46
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch 2 times, most recently from e55866f to 322814a Compare July 28, 2026 20:01
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from dbf0fe9 to cf550d4 Compare July 28, 2026 21:30
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 322814a to 87a1c1a Compare July 28, 2026 21:30
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from cf550d4 to 3414896 Compare July 29, 2026 15:32
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 87a1c1a to 875de0b Compare July 29, 2026 15:32
@kellyw1806
kellyw1806 marked this pull request as ready for review July 29, 2026 15:46
@kellyw1806
kellyw1806 requested review from BeltranBulbarellaDD and Copilot and removed request for Copilot July 29, 2026 15:59

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

Let me know what you think! I think these comments will make the flags load almost instantly.

Comment thread developer-extension/src/panel/components/tabs/flagsTab/flagCatalog.ts Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/flagCatalog.ts Outdated
Comment thread developer-extension/src/panel/components/tabs/flagsTab/flagTypeConstants.ts Outdated
Comment on lines +96 to +107
let offset = 0

for (let page = 0; page < MAX_PAGES; page++) {
const url = new URL(`https://${host}/api/ui/ffe/feature-flags`)
url.searchParams.set('limit', String(PAGE_LIMIT))
url.searchParams.set('offset', String(offset))

const response = await fetch(url.toString(), {
headers: {
Authorization: `Bearer ${token}`,
},
})

@BeltranBulbarellaDD BeltranBulbarellaDD Jul 30, 2026

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.

Suggested change
let offset = 0
for (let page = 0; page < MAX_PAGES; page++) {
const url = new URL(`https://${host}/api/ui/ffe/feature-flags`)
url.searchParams.set('limit', String(PAGE_LIMIT))
url.searchParams.set('offset', String(offset))
const response = await fetch(url.toString(), {
headers: {
Authorization: `Bearer ${token}`,
},
})
const url = new URL(`https://${host}/api/ui/ffe/feature-flags`)
url.searchParams.set('page[limit]', String(request.pageSize))
url.searchParams.set('page[offset]', String((request.page - 1) * request.pageSize))
if (request.search) {
url.searchParams.set('search', request.search)
}
for (const type of request.typeFilter) {
url.searchParams.append('value_type', type)
}
for (const tag of request.tagFilter) {
url.searchParams.append('tags', tag)
}
const response = await fetch(url.toString(), {
headers: {
Authorization: `Bearer ${token}`,
},
})

Instead of a for loop what do you think of this.
Because reading the API docs: "Pagination is always applied: the response includes meta.page (with total) and pagination links." Link.
So no need to do the loop to get the total we can request the 20 we will show and offset on page change. I think this way it loads faster and does not get unnecessary info.

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.

And then we can really simplify the useFlagCatalogView

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 think this might not work because it clashes with a couple of features the later PRs in this stack add, which both need the whole flag list loaded at once. For example, for overrides, you can override a flag's value locally, and we bump the ones you've overridden to the top so they're easy to find and the server can't do that (because it doesnt know which flags you overrode since they are stored locally in browser) A couple of the filters also break like the Tag and My Teams filter. So thinking maybe we keep the list loading client-side for now? Might also discuss this more with my team to see if they want to analyze this tradeoff

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.

Good point about locally overridden flags, but I don’t think caching every fetched flag in local storage solves it. Also I believe the endpoint supports search, type, regular-tag, and team-tag filtering server-side, so those filters shouldn’t require the complete catalog.
As for the following PRs in my opinion is better to tackle it when it comes. Else it's hard to keep track of both at the same time.

I'm thinking, what about having 2 parts?. The locally overriden flags in a set() above, when we open the extension we do a search for each to see if they match the server. And then below we have the rest. Where each time we do a pagination/search/filter we first check the results agains the set() so we don't show them twice.
This is because I am not confortable with fetching 2k feature flags on load each time.

Screenshot 2026-07-31 at 10 08 32

placeholder="Filter your feature flags"
leftSection={<IconSearch size={14} />}
value={view.search}
onChange={(event) => view.setSearch(event.currentTarget.value)}

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 think we could use a debounce here, like 3 secs so we don't run a search as soon as we write a character.

@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2597 branch from 3414896 to 34fc366 Compare July 30, 2026 20:00
@kellyw1806
kellyw1806 force-pushed the kelly.wang/ffl-2858 branch from 875de0b to 2c6bb67 Compare July 30, 2026 20:00
Base automatically changed from kelly.wang/ffl-2597 to main July 30, 2026 20:34
Builds on FFL-2597: fetches the flag catalog via the OAuth-capable FFE UI
endpoint (transparently refreshing the token), and renders it with
search + type/tag filters and pagination. Read-only; overriding flags
comes in FFL-2596.
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