Commit Graph

14 Commits

Author SHA1 Message Date
Matias Chomicki 94874823ce
New Log Context: Scroll and resize improvements (#109143)
* LogList: keep scroll position after scrolling top

* Infinite Scroll: add unit tests

* Remove log

* Remove log

* LogList: unify height calculation

* LogList: manage list height with resize observer

* LogLineDetails: report app with details displayed
2025-08-05 15:03:03 +02:00
Hugo Häggmark bfd33467fb
Tests: removes jest duplicate manual mock warning (#107459)
* Tests: removes jest duplicate manual mock warning

* Trigger build

* Trigger build
2025-07-02 09:25:25 +02:00
Jack Westbrook 1ca9910736
Grafana Data: Use package.json exports for internal code (#102696)
* refactor(frontend): rename all @grafana/data/src imports to @grafana/data

* feat(grafana-data): introduce internal entrypoint for sharing code only with grafana

* feat(grafana-data): add test entrypoint for data test utils usage in core

* refactor(frontend): update import paths to use grafana/data exports entrypoints

* docs(grafana-data): update comment in internal/index.ts

* refactor(frontend): prefer public namespaced exports over re-exporting via internal

* chore(frontend): fix a couple more weird paths that typescript complains about
2025-03-25 10:48:36 +01:00
Matias Chomicki 92cc10f983
Logs: Prevent automatic scrolling on refresh after changing scroll position (#102463) 2025-03-20 21:14:02 +00:00
Jack Westbrook 5cd8547131
Revert "Grafana Data: Use package.json exports for internal code (#102286)
Revert "Grafana Data: Use package.json exports for internal code (#102036)"

This reverts commit 91116de790.
2025-03-17 12:26:59 +00:00
Jack Westbrook 91116de790
Grafana Data: Use package.json exports for internal code (#102036)
* refactor(frontend): rename all @grafana/data/src imports to @grafana/data

* feat(grafana-data): introduce internal entrypoint for sharing code only with grafana

* feat(grafana-data): add test entrypoint for data test utils usage in core

* refactor(frontend): update import paths to use grafana/data exports entrypoints

* docs(grafana-data): update comment in internal/index.ts

* refactor(frontend): prefer public namespaced exports over re-exporting via internal
2025-03-17 11:27:17 +01:00
Matias Chomicki 52673ad390
Log rows: Refactor as functional components and remove render preview (#98025)
* LogRow: migrate to functional component

* LogRowContextModal: remove dependency between test cases

* LogRows: turn into functional component

* LogRows: try GhostRow, preview, and move event listeners to the parent

* LogRows: adjust preview size for few log rows

* Explore: optimize inline and derived props

* Remove log

* Logs: restore set displayed fields

* Refactor props that cause re-renders

* Unmemoize shouldShowMenu

* Refactor to PreviewLogRow and add preview to DisplayedFields

* Refactor moving listeners to parent

* Update unit tests

* LogRows: update preview size to twice screen height

* Revert change

* Update unit test

* Update utils test

* Update logsPanel unit test

* Improve permalinking

* LogRows: decrease preview size

* PreviewRow: render log entry

* Prettier

* LogRow: update unit test

* Update missing props

* Fix logs volume toggling

* Destructure prop
2024-12-18 19:03:47 +01:00
Matias Chomicki aace94438e
Logs: Allow scroll to reach the bottom of the log list before loading more (#96668)
* Infinite scroll: use timestamps to improve scrolling experience

* Add unit tests
2024-11-19 19:12:41 +02:00
Matias Chomicki 40c6f741c0
Logs: Show older logs button when infinite scroll is enabled and sort order is descending (#91060)
* LogsNavigation: show older logs button when the order is descending

* LogsNavigation: adjust styles for showing only older logs button

* Logs Navigation: revert changes

* Infinite scroll: add older logs button

* Older logs button: show only in explore

* chore: add unit test

* Formatting

* Update public/app/features/logs/components/InfiniteScroll.test.tsx

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Chore: add missing translation

* Chore: move the button a tiny bit

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2024-08-15 18:17:47 +03:00
Ashley Harrison 47f8717149
React: Use new JSX transform (#88802)
* update eslint, tsconfig + esbuild to handle new jsx transform

* remove thing that breaks the new jsx transform

* remove react imports

* adjust grafana-icons build

* is this the correct syntax?

* try this

* well this was much easier than expected...

* change grafana-plugin-configs webpack config

* fixes

* fix lockfile

* fix 2 more violations

* use path.resolve instead of require.resolve

* remove react import

* fix react imports

* more fixes

* remove React import

* remove import React from docs

* remove another react import
2024-06-25 12:43:47 +01:00
Matias Chomicki 15a641a509
Infinite Scroll: wait for users to reach the top before triggering new requests (#84318)
* Infinite Scroll: wait for users to reach the top before triggering new requests

* Prettier

* Infinite Scroll: control top scrolling via prop

* Prettier
2024-03-15 13:52:55 +01:00
Matias Chomicki e749c2b062
Infinite scroll: implementation clean up (#81725)
* Infinite scroll: clean up for clarity

* Infinite scroll: clean up test

* Formatting

* Infinite scroll: disable by feature flag

* Infinite scroll: improve visibility of the lower loader
2024-02-02 14:45:20 +02:00
Matias Chomicki 88ee7a1c62
Infinite scroll: exclude visible range from new requests (#80638)
* Infinite scroll: exclude visible range from new requests

* Infinite scroll: revert skipping 1 millisecond on new requests

* Formatting

* Logs models: filter exact duplicates in the response

* mergeDataSeries: do not mutate currentData

* runMoreLogsQueries: return queryResponse while loading

* Infinite scrolling: use special refId for infinite scrolling queries

* Remove log

* Update public/app/features/logs/logsModel.ts

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* combinePanelData: refactor and add unit test

* logsModel: export infinite scroll refid

* Formatting

* logsModel: add deduplication unit test

* Formatting

* findMatchingRow: add unit test

* Fix test title

* Fix imports order

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2024-01-17 21:12:09 +01:00
Matias Chomicki aa670280fc
Logs: add infinite scrolling to Explore (#76348)
* Explore: propose action, thunk, and decorators for load more

* LogsContainer: add loadMore method

* Query: remove unused var

* Loading more: use navigation to simulate scrolling

* Explore: figure out data combination

* Fix imports

* Explore: deduplicate results when using query splitting

* LogsNavigation: add scroll behavior

* Remove old code

* Scroll: adjust delta value

* Load more: remove refIds from signature

We can resolve them inside Explore state

* Load more: rename to loadMoreLogs

* Infinite scrolling: use scrollElement to listen to scrolling events

* Explore logs: add fixed height to scrollable logs container

* Logs: make logs container the scrolling element

* Logs: remove dynamic logs container size

It works very well with 1 query, but breaks with more than 1 query or when Logs is not the last rendered panel

* Logs navigation: revert changes

* Infinite scroll: create component

* Infinite scroll: refactor and clean up effect

* Infinite scroll: support oldest first scrolling direction

* Infinite scroll: support loading oldest logs in ascending and descending order

* Infinite scroll: use scroll to top from logs navigation

* Logs: make logs container smaller

* Logs: make container smaller

* State: integrate explore's loading states

* Infinite scroll: add loading to effect dependency array

* Infinite scroll: display message when scroll limit is reached

* Infinite scroll: add support to scroll in both directions

* Infinite scroll: capture wheel events for top scroll

* scrollableLogsContainer: deprecate in favor of logsInfiniteScrolling

* Infinite scroll: implement timerange limits

* Infinite scroll: pass timezone

* Fix unused variables and imports

* Infinite scroll: implement timerange limits for absolute time

* Infinite scroll: fix timerange limits for absolute and relative times

* Infinite scroll: reset out-of-bounds message

* Logs: make container taller

* Line limit: use "displayed" instead of "returned" for infinite scrolling

* Infinite scrolling: disable behavior when there is no scroll

* Remove console log

* Infinite scroll: hide limit reached message when using relative time

* Logs: migrate styles to object notation

* Prettier formatting

* LogsModel: fix import order

* Update betterer.results

* Logs: remove exploreScrollableLogsContainer test

* Infinite scroll: display loader

* Infinite scroll: improve wheel handling

* Explore: unify correlations code

* Explore: move new function to helpers

* Remove comment

* Fix imports

* Formatting

* Query: add missing awaits in unit test

* Logs model: add unit test

* Combine frames: move code to feature/logs

* Explore: move getCorrelations call back to query

It was causing a weird test failure

* Fix imports

* Infinite scroll: parametrize scrolling threshold

* Logs: fix overflow css

* Infinite scroll: add basic unit test

* Infinite scroll: add unit test for absolute time ranges

* Formatting

* Explore query: add custom interaction for scrolling

* Query: move correlations before update time

* Fix import in test

* Update comment

* Remove comment

* Remove comment

* Infinite scroll: report interactions from component

* Fix import order

* Rename action

* Infinite scroll: update limit reached message

* Explore logs: remove type assertion

* Update betterer
2024-01-12 13:22:03 +02:00