Commit Graph

5 Commits

Author SHA1 Message Date
Matias Chomicki b63b4596a0
New Logs Panel: Log line tokenization and syntax highlighting (#101401)
* Logs: preprocess and highlight with Prism

* Processing: highlight logs on demand

* LogList: reset sizes when wrap changes

* Extend base grammar to support numbers, dates, strings, and fields

* Refactor grammar

* LogList: fix size recalculation after logs update

* LogLine: add ansi support

* Processing: Use raw instead of entry

* Capitalize level

* Remove colors from timestamps

* added highlight colors

* Fix oopsies

* LogLine: Remove repeated css attribute

* Log grammar: update log token string

* Formatting

* LogLine: fix underflow detection

* Grammar: fine tune, add durations

* LogLine: change rgba colors to theme colors

* Update tests

* Grammar: add uids

* LogLine: dont render empty logLevel when logs are wrapped

* Virtualization: fix calculation when level is unknown

* Remove console log

* Chore: fix log line message

* LogLine: remove opacity change on hover

* LogLine: tweak colors and highlight urls

* Tweak colors, remove numbers

* Remove unnecessary selector

* Fix imports

* Chore: move dimensions code to virtualization

* processing: add unit tests

* Revert change

* Grammar: add unit tests

* Remove stale assertion

* LogLine: define critical color

* Fix alpha dependency

---------

Co-authored-by: Joan <zizzpudding@gmail.com>
Co-authored-by: Joan Wortman <joanwortman@Joans-MacBook-Air-2.local>
2025-03-26 12:48:26 +01:00
Matias Chomicki d78c646f93
New Logs Panel: Log line menu (#101060)
* Create LogLineMenu component

* Fine tune icon width

* LogLineMenu: Add placeholder options

* utils: create reusable handleOpenLogsContextClick

* LogLineMenu: add callbacks to menu items

* LogListContext: create component

* LogList: use log list context to connect menu callbacks

* LogLine: add pinned style

* Remove unused imports

* LogLine: add unit test

* LogLine: add menu test case

* LogLineMenu: add unit test

* LogLineMessage: add unit test

* LogListContext: add unit test

* Remove unused code

* Extract translations

* Fix handleOpenLogsContextClick

* Chore: memoize styles

* Virtualization: update node used for underflow detection

* Use useStyles2 instead of manually memoizing

* Virtualization: export getter instead of variable

* Open context: move stopPropagation to the old panel code

* Logs: add new container class
2025-02-27 18:34:02 +02:00
Matias Chomicki 03dcd25a32
New Logs Panel: Displayed fields support (#100643)
* LogList: add displayedFields and getFieldLinks props

* Render displayed fields

* LogLine: rename function

* Refactor log dimensions

* Generate styles in parent component

* Log List: implement tabular unwrapped logs

* Rename class

* Log line: center fields

* Parametrize field gap

* Virtualization: update measurement to support displayed fields

* Shorten visible level

* Do not calculate dimensions when logs are wrapped

* Logs Navigation: fix width when flag is enabled

* Pass styles to LogLineMessage

* Formatting

* Fix unwrapped logs when showTime is off

* LogLine: update css selectors for fields
2025-02-27 12:31:55 +02:00
Matias Chomicki b814f1628f
New Logs Panel: Add infinite scrolling support (#99773)
* Create Infinite Scroll wrapper component

* Logs list: refactor event subscriber

* Infinitely load logs

* Move renderer to Infinite Scroll component

* Implement infinite scroll state

* Switch internal implementation to use the existing infinite scrolling component logic

* Integrate with logs panel

* Move scrolling management to infinite scrolling component

* LogList: change subscription dependency to prevent unnecessary runs

* Infinite scroll: remove autoscrolling

* Logs Panel: fix dependencies to prevent re-renders on refresh

* Infinite scroll: introduce pre-scroll state

* LogList: expose initial log position prop

* Infinite scroll: less work on scroll and autoscroll behavior

* Remove console

* Fix imports

* Add infinite scroll translations

* Fix imports

* Add visual delimiter for new pages and increase gap

* Remove log

* Chore: rename interface to LogListModel

* Hover: decrease opacity

* Fix no-logs state

* Prettier

* Infinite scroll: move scroll delimiter

* Load more message: make it clickable
2025-02-14 13:52:34 +02:00
Matias Chomicki ff926c5ac5
Logs Panel: Base elements for the new visualization (#99084)
* Create base components

* Create measurement service

* Add container for list

* Use measurement to render virtualized log lines

* Match rendered styles in 2d context for measuring

* Improve virtualization initialization and handle resize

* Introduce log line processing

* Virtualization: fix measurement of lines with line endings

* Virtualization: include scrollbar width in calculation

* Remove logs

* Virtualization: optimize text measurement

* Add support for forceEscape

* Log line: properly style wrapped/unwrapped lines

* Virtualization: handle possible overflows

* Improve overflow handling

* LogList: remove scroll position ref

* Remove logs

* Remove log

* Add top/bottom navigation buttons

* Add timestamp to pre-processing

* Add showtime support

* Fix imports

* Chore: simplify dedup

* Show level

* Refactor measurement and measure level and timestamp

* Virtualization: skip unnecessary measurements

* Improve measurements to minimize overflow chance

* Introduce logline colors

* Update palette

* Remove pretiffying

* Add comment

* Remove unused variable

* Add color for info level

* Fix dependencies

* Refactor overflow to account for smaller estimations

* Debounce resizing

* Fix imports

* Further optimize height calculation

* Remove outline

* Unused import

* Use less under/overflow method

* Respond to height changes

* Refactor size adjustment to account for layout changes

* Add Logs Panel support

* Add margin bottom to log lines

* Remove unused option

* LogList: container div should never be null

Bad API design

* Log List: make app not undefined and update containerElement usages

* New Logs Panel: Create as new visualization (#99427)

* Logs Panel: clean up old panel

* Logs Panel New: create as new visualization

* Plugin: mark as alpha

* Logs panel new: hold container in a state variable

* Logs panel: fix no data state

* Create newLogsPanel feature flag

* Logs: use new feature flag

* Prettier

* Add new panel to code owners

* Logs Navigation: add translations

* Address betterer issues

* Fix import

* Extract translations

* Update virtualization.ts

* Virtualization: add DOM fallback for text measurement

* Run gen-cue

* plugins_integration_test: add logs-new to expected plugins
2025-02-04 18:40:17 +01:00