Skip to content

Conversation

DianaXWiki
Copy link
Contributor

This PR aims to fix #1831, across all apps mentioned in the issue

@DianaXWiki DianaXWiki self-assigned this Mar 27, 2025
@davidbenque davidbenque added this to the Summer Release (2025.6.0) milestone Mar 28, 2025
@DianaXWiki DianaXWiki marked this pull request as ready for review March 31, 2025 09:19
@davidbenque davidbenque changed the title Make toolbar responsive across all apps Make text area markdown toolbar responsive Apr 2, 2025
@DianaXWiki DianaXWiki added the Ready to Review This PR is ready to be checked by another team member label Apr 3, 2025
@davidbenque davidbenque removed the Ready to Review This PR is ready to be checked by another team member label Apr 22, 2025
@DianaXWiki DianaXWiki added the Ready to Review This PR is ready to be checked by another team member label May 14, 2025
@davidbenque
Copy link
Contributor

Some review comments

  • As soon as the Kanban edit modal stops growing in width we should show the markdown toolbar. At the moment between ~530px and 800px wide the toolbar isn't shown.
  • Toggle style for when Toolbar is shown/hidden (like Preview or Tools in the Code app). Implement for light and dark mode
  • Button styling
  • Kanban
    • Adjust background color of toolbar to match that of Forms
  • Profile description field
    • Match style of the Kanban toolbar (background, buttons)
    • Apply rounded corners (toolbar at the top and text area bottom)
    • check issue when resizing up where toolbar ends up longer than the text-area
  • Form
    • Check regression: outline around choice question options in edit mode
    • Add tools for "Submit Message" field

@davidbenque davidbenque removed the Ready to Review This PR is ready to be checked by another team member label May 22, 2025
@DianaXWiki
Copy link
Contributor Author

Found a new issue: Markdown toolbar never appears for the submit message section. This PR aims to fix it as well.

@DianaXWiki DianaXWiki added the Ready to Review This PR is ready to be checked by another team member label May 28, 2025
@davidbenque
Copy link
Contributor

Design issues to finalise (by me):

  • "tools" button styling
  • button text ("tools" without context is not great so adding a new "text tools" translation key)

@davidbenque davidbenque self-assigned this Jun 4, 2025
Copy link
Contributor

@yflory yflory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the specific comments in the code, I feel like this PR is adding a lot of complexity in our available tools.
With these changes, ff we want to create a markdown toolbar for a new app, we'll need to call 3 or 4 functions and also some event listeners. Some parts of the code are duplicated in multiple apps.

I would prefer to keep our single function "createMarkdownToolbar" that returns a "div" node, and this node's content automatically updates depending on the situation.

  • full list of button on a big screen
  • "Show" button for small screen and, when clicking on it, the button are added to the initial element
  • Listen for "resize" inside this function

Basically, merge UIElements.updateToolbarVisibility and UIElements.createMarkdownToolbarToggle into createMarkdownToolbar, and keep the same definition for the markdown toolbar: let toolbar = UIElements.cvreateMarkdownToolbar(editor);

@yflory yflory removed the Ready to Review This PR is ready to be checked by another team member label Jun 6, 2025
@yflory yflory force-pushed the markdown-toolbar-not-responsive branch from 7f6fba5 to 0fe3f51 Compare June 13, 2025 14:58
yflory
yflory previously approved these changes Jun 13, 2025
@yflory yflory self-requested a review June 13, 2025 15:18
@yflory yflory dismissed their stale review June 13, 2025 15:19

Error

@DianaXWiki DianaXWiki added the Ready to Review This PR is ready to be checked by another team member label Jun 17, 2025

var toolbarVisibleOnSmallScreen = false;
var $toolbarToggleButton = null;
var appType = common.getMetadataMgr().getMetadata().type;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend to use

var appType = common.getMetadataMgr().getPrivateData().app;

getMetadata() may not be available for all the apps.


if (isSmallScreen()) {
if (!$toolbarToggleButton) {
$toolbarToggleButton = $('<button>', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to use hyperscript to make new elements:

$toolbarToggleButton = $( h('button.btn.cp-markdown-toggle-button', {
   'aria-label': ...
})).append([
  h('i.fa.fa-wrench', { ... }),

@yflory yflory added Ready to Test This PR is ready to be tested and removed Ready to Review This PR is ready to be checked by another team member labels Jun 17, 2025
@davidbenque
Copy link
Contributor

image

At smaller widths (675px pictured) the description text area is shown with neither toolbar nor toggle button. toolbar shows once I resize the window

@yflory yflory merged commit 19fe19a into staging Jun 23, 2025
@davidbenque davidbenque removed the Ready to Test This PR is ready to be tested label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants