[#130] Implement compendium browser#1929
Draft
krbz999 wants to merge 2 commits into
Draft
Conversation
94caf1d to
7fa4f9b
Compare
7fa4f9b to
dd4e07b
Compare
JPMeehan
reviewed
Jun 5, 2026
Comment on lines
+10
to
+45
| /** | ||
| * @typedef {Record<string, -1|0|1>} BrowserCheckboxFilter | ||
| * | ||
| * @typedef {{ min: number, max: number }} BrowserRangeFilter | ||
| * | ||
| * @typedef {Record<string, BrowserCheckboxFilter|BrowserRangeFilter>} BrowserFilterConfiguration | ||
| * | ||
| * @typedef {Record<string, boolean|Record<string, boolean>>|boolean} BrowserLockedConfiguration | ||
| * | ||
| * @typedef {"Actor"|"Item"} FilterDocumentName | ||
| * | ||
| * @typedef {DrawSteelActor|DrawSteelItem} BrowserDocument | ||
| * | ||
| * @typedef {(entry: object, filters: BrowserFilterConfiguration) => boolean} CompendiumFilterCallback | ||
| * | ||
| * @typedef {(filters: BrowserFilterConfiguration) => boolean} CompendiumFilterVisibility | ||
| * | ||
| * @typedef {Set<BrowserDocument|object>} BrowserFetchResults | ||
| * | ||
| * @typedef CompendiumFilter | ||
| * @property {string} [label] Human-readable label. | ||
| * @property {"checkboxes"|"range"} type The display type of the filter. | ||
| * @property {CompendiumFilterCallback} callback A callback invoked when filtering an entry. | ||
| * @property {CompendiumFilterVisibility} [visible] A callback invoked to determine visibility. | ||
| * @property {FilterDocumentName[]} modes Which modes have this filter available. | ||
| * @property {{ value: string, label: string }[]} [options] The array of options to display in a checkbox-like fashion. | ||
| * @property {number[]} [range] An 2-length array which determines the min/max of a 'range'. | ||
| * | ||
| * @typedef _CompendiumBrowserOptions | ||
| * @property {FilterDocumentName} [documentName="Item"] Initial document type to browse. | ||
| * @property {BrowserFilterConfiguration} [filters] Initial filters. | ||
| * @property {BrowserLockedConfiguration} [locked] Locked filters. | ||
| * @property {number} [selection] Number of documents to select. | ||
| * | ||
| * @typedef {_CompendiumBrowserOptions & ApplicationConfiguration} CompendiumBrowserOptions | ||
| */ |
Contributor
There was a problem hiding this comment.
Should this get moved to an adjoining _types.d.ts file and imported?
Comment on lines
+520
to
+521
| min: foundry.utils.getProperty(this.#filter, `${name}.min`) ?? null, | ||
| max: foundry.utils.getProperty(this.#filter, `${name}.max`) ?? null, |
Contributor
There was a problem hiding this comment.
Is this better stylistically than chaining optional operators?
| result.dataset.uuid = uuid; | ||
| result.dataset.dragstart = ""; | ||
| result.dataset.name = name; | ||
| if (displayTooltip) result.dataset.tooltipHtml = CONFIG.ux.TooltipManager.constructHTML({ uuid }); |
Contributor
There was a problem hiding this comment.
I hate that this is more efficacious than the implementation reference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked by a few required features and TODOs: