Skip to content

Move bulleted/ordered list and tables editor buttons to the first level#1619

Merged
Oaphi merged 6 commits intodevelopfrom
0valt/editor
May 13, 2025
Merged

Move bulleted/ordered list and tables editor buttons to the first level#1619
Oaphi merged 6 commits intodevelopfrom
0valt/editor

Conversation

@Oaphi
Copy link
Member

@Oaphi Oaphi commented May 11, 2025

Re: meta:293936 (doesn't close it, but related) and meta:293940 (partially addresses it)

Unfortunately, it competes with #1618 and will make it obsolete if merged. (merged in as per discussion)

Rationale

It's very unusual for editor tools to not show list management buttons at first level, so I think we should not reinvent the wheel. Examples:

GitHub editor tools:
2025-05-12_01-59

Stack Overflow editor tools:
2025-05-12_02-00

Well-known CKEditor:
2025-05-12_02-01

And countless others.

Changes

The change makes the tools panel look like this for a sufficiently wide viewport (note that list and table insertion buttons are no longer wrapped under the "tools" modal):
2025-05-12_03-00

And like this for a narrow one (we should improve button positioning on narrow viewports in general, but that's outside the scope of the PR):
2025-05-12_03-00_1

@Oaphi Oaphi requested review from a team and cellio May 11, 2025 23:03
@Oaphi Oaphi self-assigned this May 11, 2025
@cellio
Copy link
Member

cellio commented May 11, 2025

I'm happy to defer to this PR and close mine. Would you be willing to expand the tooltip here to reflect what's still in there? In particular, while lines and headings are kind of uninteresting, tables should probably be more findable than they are.

Copy link
Member

@cellio cellio left a comment

Choose a reason for hiding this comment

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

LGTM other than the tooltip question.

@Oaphi
Copy link
Member Author

Oaphi commented May 11, 2025

In particular, while lines and headings are kind of uninteresting, tables should probably be more findable than they are.

@cellio what do you think about moving the table button to the first level too (I think it's best suited with the other "insert" buttons)? This is common practice to do so as well

@Oaphi
Copy link
Member Author

Oaphi commented May 11, 2025

LGTM other than the tooltip question.

Sounds good to me, I'll merge your PR into mine then (after the CI pipeline finishes running that is) so as we get the best of both worlds.

expanded tooltip for 'tools' button in editor
@Oaphi Oaphi added the area: frontend Changes to front-end code label May 11, 2025
@cellio
Copy link
Member

cellio commented May 11, 2025

Sounds good to me, I'll merge your PR into mine then (after the CI pipeline finishes running that is) so as we get the best of both worlds.

Works for me. I agree with promoting tables, at which point we're down to two tools right now. You'll need to adjust the wording on the tooltip.

@codecov
Copy link

codecov bot commented May 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.59%. Comparing base (b796469) to head (fbd3a40).
Report is 19 commits behind head on develop.

Additional details and impacted files
Components Coverage Δ
controllers 60.56% <ø> (ø)
helpers 68.84% <ø> (ø)
jobs 28.00% <ø> (ø)
models 81.87% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oaphi
Copy link
Member Author

Oaphi commented May 11, 2025

Works for me. I agree with promoting tables, at which point we're down to two tools right now

@cellio agreed then, will do shortly - and we can also partially address another request that's just came in: meta:293940

@Oaphi Oaphi requested review from cellio and trichoplax May 12, 2025 00:05
@Oaphi Oaphi changed the title Move bulleted/ordered list editor buttons to the first level Move bulleted/ordered list and tables editor buttons to the first level May 12, 2025
attribs.merge! href: 'javascript:void(0)',
class: "#{attribs[:class] || ''} button is-muted is-outlined js-markdown-tool",
data_action: action,
draggable: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Forgot to mention it, but this change solves a minor issue of being able to drag & drop markdown buttons themselves into the editor (resulting in javascript:void(0) being inserted)

Copy link
Member

@cellio cellio left a comment

Choose a reason for hiding this comment

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

LGTM.

@Oaphi Oaphi merged commit 242f951 into develop May 13, 2025
10 checks passed
@Oaphi Oaphi deleted the 0valt/editor branch May 13, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Changes to front-end code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants