forms icon indicating copy to clipboard operation
forms copied to clipboard

feat: introduce Section as a new question type

Open AIlkiv opened this issue 4 months ago • 10 comments

Based on https://github.com/nextcloud/forms/pull/2824

@Chartman123 This is an interesting feature because in the future it can be expanded to split one form into pages by section. It can also be expanded to display pages only when a certain condition is met. Much has already been written about this.

Demo: https://github.com/user-attachments/assets/fc7edb0d-1f24-4493-9c48-0a90dda21052

The only problem I haven't figured out how to solve is that on the mobile layout, the menu partially overlaps the Section (you can see it in the demo).

AIlkiv avatar Sep 08 '25 06:09 AIlkiv

Codecov Report

:x: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review. :white_check_mark: Project coverage is 44.23%. Comparing base (8eb7508) to head (30e54c4). :warning: Report is 129 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2913      +/-   ##
============================================
+ Coverage     44.18%   44.23%   +0.04%     
- Complexity     1031     1032       +1     
============================================
  Files            80       80              
  Lines          3705     3710       +5     
============================================
+ Hits           1637     1641       +4     
- Misses         2068     2069       +1     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Sep 08 '25 09:09 codecov[bot]

The only problem I haven't figured out how to solve is that on the mobile layout, the menu partially overlaps the Section (you can see it in the demo).

@AIlkiv @susnux I could imagine that we move the form title to the top bar like in Talk where the chat name is visible there. In Forms we could do it like this:

  • Show the title normally in the app content as long as it's visible
  • Move the title to the top bar as soon as it scrolls out of the visible area
  • Always place the top bar above the app content
  • Stick the section below the top bar.

One problem I can see with your current implementation: If there is a very long description added to a section, you're not able to see the questions anymore.

Chartman123 avatar Sep 08 '25 10:09 Chartman123

One problem I can see with your current implementation: If there is a very long description added to a section, you're not able to see the questions anymore.

I can add max-height + overflow-y: auto

AIlkiv avatar Sep 08 '25 10:09 AIlkiv

@Chartman123 I have already added a height restriction for the block.

demo:

https://github.com/user-attachments/assets/13c6eb99-1e6c-44d9-9e8f-a138c76830c8

AIlkiv avatar Sep 08 '25 11:09 AIlkiv

@Chartman123 If the only problem is the menu overlap, then I suggest we merge this PR and discuss the layout change in a new issue, as it goes beyond the scope of this task.

AIlkiv avatar Sep 16 '25 08:09 AIlkiv

@AIlkiv no, we should do this in this PR already before merging. Other than that our main branch is currently ready for the 5.2 release and I'd like to have this in the 5.3 release, so we need to wait until we branch off the stable 5.2

I also don't like the scrollbars that also appear when there's still enough space for the description... So I added Jan and Nimisha from the design team to have a look :)

Chartman123 avatar Sep 16 '25 08:09 Chartman123

I also don't like the scrollbars that also appear when there's still enough space for the description... So I added Jan and Nimisha from the design team to have a look :)

@Chartman123 Scroll appears only for long descriptions.

AIlkiv avatar Sep 16 '25 09:09 AIlkiv

I am not really sure about the implementation as a question type. Its not really a question type but rather some formatting / structuring. I know we have also feature requests for paged forms, so maybe we should rather think about a besser way to represent such cases then misuse question types for it. Examples could be 'forms-sections' which could be assigned to a question or similar, something one could brainstorm about.

susnux avatar Oct 10 '25 14:10 susnux

I am not really sure about the implementation as a question type. Its not really a question type but rather some formatting / structuring. I know we have also feature requests for paged forms, so maybe we should rather think about a besser way to represent such cases then misuse question types for it. Examples could be 'forms-sections' which could be assigned to a question or similar, something one could brainstorm about.

@susnux In the current context, you are right. But we can expand it and call it “form element” instead of “question.” I think introducing a new entity will complicate the module more than changing “question.”

To add output to pages in the future, we will simply need to add a “separate page” checkbox to the Section settings in the current implementation.

AIlkiv avatar Oct 11 '25 07:10 AIlkiv

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

github-actions[bot] avatar Oct 31 '25 02:10 github-actions[bot]