Commit graph

1297 commits

Author SHA1 Message Date
Raimond Spekking 1882c463f2 Merge "Localisation updates from https://translatewiki.net." 2024-08-29 16:31:16 +00:00
jenkins-bot 1bae4d71c9 Merge "[refactor] Update some usages to new refs interface" 2024-08-29 12:23:14 +00:00
Adam Wight 633969300b [refactor] Update some usages to new refs interface
Change-Id: Idfffbe92ad1385e85b078bc4794a529c5f770eae
2024-08-29 13:21:48 +02:00
Translation updater bot 568cbfdd12
Localisation updates from https://translatewiki.net.
Change-Id: I2f148433c357c0f7a6804d703768fc5b48c70a7f
2024-08-29 09:17:33 +02:00
jenkins-bot 43274e9716 Merge "Reword the missing main ref hint in editing and context menu" 2024-08-28 13:47:18 +00:00
jenkins-bot 179e12f4ec Merge "[refactor] groupInput takes narrower parameters" 2024-08-28 08:09:55 +00:00
jenkins-bot 99d2cce694 Merge "[refactor] New interface in MWReferenceContextItem" 2024-08-28 08:06:54 +00:00
jenkins-bot 95263957a1 Merge "Clean up reflist usage of MWGroupReferences" 2024-08-28 08:03:25 +00:00
Adam Wight b69614fc82 [refactor] groupInput takes narrower parameters
Simple parameters hide knowledge and ease testing.

Change-Id: I9a8549199a1de07b437caf274c8d5e842183f570
2024-08-28 05:48:44 +00:00
Adam Wight 8c08491752 [refactor] New interface in MWReferenceContextItem
Switch to MWGroupReferences interface.

Change-Id: If6b0ee307ea8d44de8859953135be6e06f3e19e3
2024-08-28 05:47:31 +00:00
Adam Wight 35e8af7d40 Clean up reflist usage of MWGroupReferences
Switch this usage entirely to the new interface, moving much of the
junk out.

Bug: T372871
Change-Id: I445af469a823144b0b6fa5e6f4f23a858939e9e6
2024-08-28 07:45:39 +02:00
Adam Wight 850586c625 [refactor] Inline single-use variables
Change-Id: Icee82498a9e7c9645ef2a9dc84be230a6d68ba42
2024-08-27 10:54:17 +00:00
jenkins-bot f282a28021 Merge "Fix and update styling in reference re-use dialog" 2024-08-27 08:15:20 +00:00
Translation updater bot bcc6e2be69
Localisation updates from https://translatewiki.net.
Change-Id: I6bee2abcca5c448fc73a8c87714f51f841db608e
2024-08-27 09:47:16 +02:00
thiemowmde a3a6091534 Fix and update styling in reference re-use dialog
This makes the dialog's behavior much more robust, especially when
confronted with overly long and complex references.
* Limit the height of list items to avoid the situation where a
  single item overflows the dialog. This makes it especially hard
  to navigate with the cursor keys. We can't see any more what's
  going on. The proposed height is intentionally a very high upper
  bound, equivalent to about 2/3 of the dialog's height.
* Limit the name on the right side to take up less than half of an
  item. The left side is for the content. Usually the names are very
  short anyway. But if a name is long it currently creates a mess
  where the name is intertwined with the content.
* Break overly long words in references.
* Changing the opacity to use upstream values makes the dimmed names
  a bit darker. I think this is good, even necessary for legibility.

Technical changes:
* Use LESS variables from upstream, where possible.
* Remove redundant `relative` already set upstream.

Bug: T372385
Change-Id: Ie59b7b7e4aa7eadc8f82b39884313f5aa8cfd950
2024-08-27 07:07:06 +00:00
WMDE-Fisch d55d641314 Reword the missing main ref hint in editing and context menu
I think that the message is more clear when it starts with the
subject we're describing. That also seems to be the case in other
messages here.

It also aligns with the wording in referenceslist-missing-parent:
"There are subreferences with a missing parent reference."

Bug: T372871
Change-Id: If9a49faccb6cbe2000b15a2d28bd66565cce0e90
2024-08-26 23:13:43 +02:00
Adam Wight ab7d60ca05 Show specific error message in reflist when parent is missing
Bug: T372871
Change-Id: Idce84adc0100dfd73f02611f2825f3be1d2da223
2024-08-26 12:33:12 +02:00
Adam Wight 6e03d2cafa Moving ref group knowledge into a dedicated data structure
Pushes per-group knowledge down into a structured object and give it
an interface, separated from the singleton cache across all groups.

Also changes the behavior of orphaned subrefs so that they're still
rendered as subrefs, with an error placeholder where the parent
should be.

Bug: T372871
Change-Id: I84e679a8365f3fbfabaf344d99f56f6d069c0776
2024-08-26 09:26:15 +00:00
Translation updater bot b21b9a339e
Localisation updates from https://translatewiki.net.
Change-Id: I26e581d81dfb23e2aaacc8a72d2048d5fc77b30b
2024-08-26 09:21:51 +02:00
jenkins-bot 1bbae40ca5 Merge "Show error message in ref edit dialog for orphaned subref" 2024-08-23 08:02:54 +00:00
Translation updater bot 4d14e6fa61
Localisation updates from https://translatewiki.net.
Change-Id: Ib15727bdb52343ec729deb34eaa03ff75c1e52e7
2024-08-23 09:45:46 +02:00
Adam Wight ce16e4a4cb Show error message in ref edit dialog for orphaned subref
Bug: T372871
Change-Id: I2b5c99f699ac4113f90b0b22913f1b7119d1d8ce
2024-08-22 17:27:51 +02:00
Adam Wight 438eed5c54 Show error placeholder in context item for orphaned subref
Bug: T372871
Change-Id: Ifc183b33793fb8e5c736488569f47838c138ce2e
2024-08-22 16:46:01 +02:00
Translation updater bot dfa08cbb03
Localisation updates from https://translatewiki.net.
Change-Id: Id8979317b7ace536692740998aeec173400f003a
2024-08-20 09:41:54 +02:00
Translation updater bot 934960b07b
Localisation updates from https://translatewiki.net.
Change-Id: Ifb602e7086bd59d3052e5c38a68bbf95f486da5e
2024-08-19 09:22:34 +02:00
Translation updater bot 203b9b7e2a
Localisation updates from https://translatewiki.net.
Change-Id: I5acd2b0a5ef95398f482678add4e6ba303b49011
2024-08-16 09:27:30 +02:00
jenkins-bot 7f14cc8679 Merge "Git rid of the ref class property in the dialog class" 2024-08-14 08:57:33 +00:00
WMDE-Fisch f5c96716f0 Git rid of the ref class property in the dialog class
The model is now fully owned by the edit panel and I could not find
any usages of this outside of that class using codesearch.

Bug: T369005
Change-Id: I911fee99d6c910e6e40e0b3cbdb4c7ab60b413c6
2024-08-13 18:41:31 +00:00
WMDE-Fisch 70e1f91bc0 Set more methods private in EditPanel class
These are just for internal use.

Bug: T369005
Change-Id: Ia3c6338c79c3ec4144727c841c24ea5066060eed
2024-08-13 20:37:42 +02:00
WMDE-Fisch 3af9dfdb71 Move event handler to the EditPanel class
Making sure that change events form the fields are handled in the
panel and forwarded to the dialog with the information needed.

Also slighly moving some calls in the setup process that inits
the dialog and removing some duplication. Calling focus on the
edit panel only makes sense in the ready step. Not during setup.

Bug: T369005
Change-Id: I4f9a022a06ec6543b106620eae030235b8f6712b
2024-08-13 15:53:24 +02:00
jenkins-bot e163f354a5 Merge "Add method to get the updated ref from the edit panel" 2024-08-13 13:22:15 +00:00
Translation updater bot 7d7a2469b8
Localisation updates from https://translatewiki.net.
Change-Id: I45f0398a3c72bf8c2d5e48e5f9e40887ac7837e3
2024-08-13 09:50:20 +02:00
WMDE-Fisch 48d0699f09 Add method to get the updated ref from the edit panel
That's another step to separate the editing form the dialog. The dialog should not know about internals of the edit panel.

And eventually the dialog can get rid of the referenceModel property.

Bug: T369005
Change-Id: I9cf3a68ef58bc5791497af362c0572734e4bcadd
2024-08-12 18:00:32 +00:00
jenkins-bot d847caf5b8 Merge "Hide main ref warning on orphan refs" 2024-08-12 13:34:09 +00:00
jenkins-bot e5808ef6fb Merge "Fix missing cursor focus visualization in reference search" 2024-08-12 09:17:18 +00:00
jenkins-bot f11e415c24 Merge "Remove obsolete disconnect()" 2024-08-12 08:59:34 +00:00
Translation updater bot bde79b6a61
Localisation updates from https://translatewiki.net.
Change-Id: I2b315df554f6a1444e9b3175d0706410893d75ed
2024-08-12 09:22:11 +02:00
WMDE-Fisch 3d0a88c384 Hide main ref warning on orphan refs
Also adding tests.

Bug: T369005
Change-Id: Icb3deaf0c8e14e34bd05455590bd9680a7a5adec
2024-08-02 15:33:44 +02:00
WMDE-Fisch 6bfe4f1c5d Remove obsolete disconnect()
I could not find any connect() was applied from this codebase to
the SurfaceModel. Looking back it seems that the code that connects
the event was removed in Icba13d84e10cf18a6c68e26448b2efe93b8c42b8
and the disconnect was never touched.

Bug: T369005
Change-Id: Ieab623751dd946ba43c42a1be144e6b3725abce3
2024-08-02 12:00:27 +02:00
WMDE-Fisch cc6aec4c77 Don't use the edit form when reusing a reference
There's no need to populate and use the form fields when we're
reusing a reference. The group and content are already stored
in the model and we can insert more directly.

I found that it's also not needed to update the internal item
because we're not changing the content or group. The same is done
in Citoid when reusing a reference.

Bug: T369003
Change-Id: I57315aafb73b0cd68a0d397d2f79833ac54a7c7f
2024-08-01 18:09:07 +02:00
jenkins-bot 8ef86b2f0f Merge "Rename function to getIndexLabel to clarify that it's presentation" 2024-08-01 06:33:30 +00:00
jenkins-bot a9b8380bcb Merge "Helper function getAllGroupNames" 2024-07-30 12:30:14 +00:00
Adam Wight baedd6c44c Rename function to getIndexLabel to clarify that it's presentation
Bug: T370874
Change-Id: I2e00aca86d2a97f8dff11b742e010ef117b5522a
2024-07-30 12:05:25 +00:00
Adam Wight 06e7dda6a3 Helper function getAllGroupNames
Bug: T370874
Change-Id: I8d61b1ab428ab30e250c8dad05d1b97e15905ed5
2024-07-30 00:00:50 +02:00
jenkins-bot caee02b888 Merge "References always deal with original document" 2024-07-29 21:29:30 +00:00
Adam Wight 3e2d060037 References always deal with original document
Singleton always steps up to the original document from fragments, to
give absolute numbering.

Bug: T370874
Change-Id: I0353649289f6c8fe26fa6bdff5d2367b7b575bac
2024-07-29 11:45:24 +02:00
WMDE-Fisch 8b60ead109 Move more editing methods to the EditPanel
Mainly leaving out the event handling for the change detection to
still keep it simple.

Also the data flow back for editing the content is still somewhat
opaque because the relevant data is passed by reference. I might
change that in follow up patches so it's more clear.

Bug: T369005
Change-Id: I93b62791ef10bf318697905af8a0c5b5d438fdb5
2024-07-26 17:45:23 +00:00
jenkins-bot c50282b381 Merge "Switch reuse dialog to use shared numbering mechanism" 2024-07-26 10:06:56 +00:00
Adam Wight 257b3f3816 Switch reuse dialog to use shared numbering mechanism
This patch gives us the same number as will appear in the document,
even when subrefs are present.

Tests could be improved using sinon to check some call assertions
but should be fine for now.

Removed the test for placeholders, because these should be filtered
in MWDocumentReferences.getGroupRefsByParents()

Bug: T370874
Change-Id: I7543a6593308c529bcfbeb0835a7c0882cbf8621
2024-07-26 09:44:36 +02:00
Translation updater bot c29b10683d
Localisation updates from https://translatewiki.net.
Change-Id: Ieb35a338d876deb54874e95d7c0ccc04d02e2e8c
2024-07-26 09:43:38 +02:00