-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
web: Merge branch -- Stale notifications, synchronized context objects, rendering fixes #19141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
25cc595
web: Fix stale notifications.
GirlBossRush df640a6
Fix overlap of API and notifications drawers.
GirlBossRush 21748c9
Fix issues surrounding duplicate context controller values.
GirlBossRush b521f30
Clean up drawer events, alignment.
GirlBossRush 616957f
Export parts. Fix z-index, colors.
GirlBossRush a712a05
Fix formatting, alignment. repeated renders.
GirlBossRush 347e30a
Fix indent.
GirlBossRush 6ed89ff
Fix progress bar fade out, positioning, labels.
GirlBossRush a08fd40
Fix clickable area.
GirlBossRush 9fe4446
Ignore clickable icons.
GirlBossRush ea8b342
Clean up logging.
GirlBossRush c265653
Fix width.
GirlBossRush da39e02
Move event listeners into decorator.
GirlBossRush 4d9f406
Fix double counting of notifications.
GirlBossRush 4800f2f
Fix ARIA lables.
GirlBossRush ea3e381
Fix empty state ARIA.
GirlBossRush 3a5d22b
Fix order of locale updating.
GirlBossRush aefa203
Merge branch 'main' into fix-stale-notifications
GirlBossRush 4004a34
Fix rebase.
GirlBossRush 24ae71b
web: fix notification count update
macmoritz 86efb6b
Update selector.
GirlBossRush e548457
web: Fix CAPTCHA locale.
GirlBossRush 9d348cc
Clean up logging.
GirlBossRush File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| /** | ||
| * @file Console logger for browser environments. | ||
| * | ||
| * @remarks | ||
| * The repetition of log levels, typedefs, and method signatures is intentional | ||
| * to give IDEs and type checkers a mapping of log methods to the TypeScript | ||
| * provided JSDoc comments. | ||
| * | ||
| * Additionally, no wrapper functions are used to avoid the browser's console | ||
| * reported call site being the wrapper instead of the actual caller. | ||
| */ | ||
|
|
||
| /* eslint-disable no-console */ | ||
|
|
||
| //#region Functions | ||
|
|
||
| /** | ||
| * @typedef {object} Logger | ||
| * @property {typeof console.info} info; | ||
| * @property {typeof console.warn} warn; | ||
| * @property {typeof console.error} error; | ||
| * @property {typeof console.debug} debug; | ||
| * @property {typeof console.trace} trace; | ||
| */ | ||
|
|
||
| /** | ||
| * Labels log levels in the browser console. | ||
| */ | ||
| const LogLevelLabel = /** @type {const} */ ({ | ||
| info: "[INFO]", | ||
| warn: "[WARN]", | ||
| error: "[ERROR]", | ||
| debug: "[DEBUG]", | ||
| trace: "[TRACE]", | ||
| }); | ||
|
|
||
| /** | ||
| * @typedef {keyof typeof LogLevelLabel} LogLevel | ||
| */ | ||
|
|
||
| /** | ||
| * Predefined log levels. | ||
| */ | ||
| const LogLevels = /** @type {LogLevel[]} */ (Object.keys(LogLevelLabel)); | ||
|
|
||
| /** | ||
| * Colors for log levels in the browser console. | ||
| * | ||
| * @remarks | ||
| * | ||
| * The colors are derived from Carbon Design System's palette to ensure | ||
| * sufficient contrast and accessibility across light and dark themes. | ||
| */ | ||
| const LogLevelColors = /** @type {const} */ ({ | ||
| info: `light-dark(#0043CE, #4589FF)`, | ||
| warn: `light-dark(#F1C21B, #F1C21B)`, | ||
| error: `light-dark(#DA1E28, #FA4D56)`, | ||
| debug: `light-dark(#8A3FFC, #A56EFF)`, | ||
| trace: `light-dark(#8A3FFC, #A56EFF)`, | ||
| }); | ||
|
|
||
| /** | ||
| * Creates a logger with the given prefix. | ||
| * | ||
| * @param {string} [prefix] | ||
| * @param {...string} args | ||
| * @returns {Logger} | ||
| * | ||
| */ | ||
| export function createLogger(prefix, ...args) { | ||
| const suffix = prefix ? `(${prefix}):` : ":"; | ||
|
|
||
| /** | ||
| * @type {Partial<Logger>} | ||
| */ | ||
| const logger = {}; | ||
|
|
||
| for (const level of LogLevels) { | ||
| const label = LogLevelLabel[level]; | ||
| const color = LogLevelColors[level]; | ||
|
|
||
| logger[level] = console[level].bind( | ||
| console, | ||
| `%c${label}%c ${suffix}%c`, | ||
| `font-weight: 700; color: ${color};`, | ||
| `font-weight: 600; color: CanvasText;`, | ||
| "", | ||
| ...args, | ||
| ); | ||
| } | ||
|
|
||
| return /** @type {Logger} */ (logger); | ||
| } | ||
|
|
||
| //#endregion | ||
|
|
||
| //#region Console Logger | ||
|
|
||
| /** | ||
| * @typedef {Logger & {prefix: (logPrefix: string) => Logger}} IConsoleLogger | ||
| */ | ||
|
|
||
| /** | ||
| * A singleton logger instance for the browser. | ||
| * | ||
| * ```js | ||
| * import { ConsoleLogger } from "#logger/browser"; | ||
| * | ||
| * ConsoleLogger.info("Hello, world!"); | ||
| * ``` | ||
| * | ||
| * @implements {IConsoleLogger} | ||
| * @runtime browser | ||
| */ | ||
| // @ts-expect-error Logging properties are dynamically assigned. | ||
| export class ConsoleLogger { | ||
| /** @type {typeof console.info} */ | ||
| static info; | ||
| /** @type {typeof console.warn} */ | ||
| static warn; | ||
| /** @type {typeof console.error} */ | ||
| static error; | ||
| /** @type {typeof console.debug} */ | ||
| static debug; | ||
| /** @type {typeof console.trace} */ | ||
| static trace; | ||
|
|
||
| /** | ||
| * Creates a logger with the given prefix. | ||
| * @param {string} logPrefix | ||
| */ | ||
| static prefix(logPrefix) { | ||
| return createLogger(logPrefix); | ||
| } | ||
| } | ||
|
|
||
| Object.assign(ConsoleLogger, createLogger()); | ||
|
|
||
| //#endregion | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #19185