Repository navigation
DataViews: Add parent relationship support - #83315
dinhtungdu wants to merge 1 commit into
Conversation
907ed40 to
234abef
Compare
🤖 PR meta 🤖🎉 PropsUnlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @ampagent. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +917 B (+0.01%) Total Size: 8.71 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. should select synced pattern in
|
c3bddec to
7235bab
Compare
7235bab to
cbb584b
Compare
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1a42f-8223-7623-a09b-7f8342758e3e
cbb584b to
264d98e
Compare
What?
Part of #80360.
Adds a
getItemParentIdcallback to DataViews. Withview.showLevelson, the table puts each loaded item under its parent and indents it by its depth.Why?
getItemLevelcan indent a row, but it cannot say which row is its parent. So when a child comes before its parent indata, the table shows it in the wrong place. A parent link fixes that. #83316 and #83320 then build expand, collapse and per-level loading on it.How?
getItemParentId, and in grouped views, the table usesgetItemLevelas before.Testing Instructions
npm run test:unit:vitest -- packages/dataviews.showLevelscontrol. The rows go back to plain order by title, with no indent.Testing Instructions for Keyboard
No keyboard behavior changes.
Screenshots or screencast
Not applicable. This PR changes the row order and reuses the existing indent.
Use of AI Tools
OpenAI Codex through Pi drafted the first implementation and tests. Amp reviewed and simplified the stack, rebased it on trunk, and checked it in a browser.