[3.x] Move the discussion list side pane out of core into a bundled extension

Aperta
#5,527 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
28/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, php

Direzione di ricerca

Start by tracing ForumApplication, PageStructure, DiscussionPage, Navigation.items(), and the pane files and styles named in the issue. Then review Embed's workaround, the upgrade guide, and the flarum/docs extension documentation structure. The work is done when the pane lives in a bundled extension, core retains a general extension point, the pinned preference survives upgrades, and the migration and extension docs are updated.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

On wide screens the discussion page has a side pane that shows the discussion list. It slides out from the left edge on hover and can be pinned open. #5525 (pinned discussion list pane does not show when loading directly to a discussion) showed how little it's used, and how much core code it costs for that:

  • It depends on a list the index page happens to leave behind. Opening a discussion by URL showed no pane until #5526 made the discussion page load the list itself when the pane is pinned.
  • It's built into core's layout.
    • ForumApplication creates app.pane, and PageStructure has a slot for it.
    • DiscussionPage turns it on and off.
    • Navigation (in common, so the admin frontend gets it too) renders the pin button.
    • Core's styles carry hasPane / panePinned rules in App.less, Navigation.less, Composer.less and DiscussionListPane.less.
  • Other extensions have to work around it. Embed has to unpin it in memory so that a pin saved on the forum doesn't load the list into an embed.

The reporter of #5525 suggested moving it to an optional extension. 3.0 is the place to do that, because removing it is a breaking change for extensions that use app.pane or the pane's markup and classes.

Proposed scope
  • New bundled extension, e.g. flarum/discussion-pane, enabled by default so existing forums keep the feature. It takes over:
    • forum/utils/Pane and forum/components/DiscussionListPane, with their styles and the --pane-width / --zindex-pane variables;
    • the pin button now added in Navigation.items();
    • turning the pane on and off on the discussion page, including loading the list on a direct load (#5526);
    • the locale strings core.lib.nav.pin_pane_button and core.forum.discussion_list.skip_discussion_list_pane.
  • Core keeps a general extension point where the pane sat, such as PageStructure's pane slot or an ItemList beside the main content. It should not know about a discussion list pane or app.pane.
  • Remove app.pane from core's Application / ForumApplication. Once the pane is an extension, Embed's workaround can go.
  • Keep the pinned preference across the upgrade: the extension keeps the panePinned localStorage key.
  • Write the upgrade guide entry for extensions that use app.pane, DiscussionListPane, the Navigation pin item or the hasPane / panePinned classes. Deck's styles are one case: extensions/deck/less/forum.less copies the pane's narrow-column rules.
  • Add a docs page for the new extension in flarum/docs (docs/extensions/<name>.md, sidebar, artwork).
Open questions
  • Enabled by default, or opt-in? Default keeps today's behaviour; opt-in matches how rarely it seems to be used.
  • Name: flarum/discussion-pane, flarum/discussion-sidebar, or something else.
Lingua principale
PHP
Stelle
6.8k
Fork
891
Merge medio
1g 10h
PR unite (30g)
209

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flarum/framework

Tutte le issue di flarum/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.