Skip to content

Add table text wrap toggle#252

Merged
jthompson-arcus merged 32 commits intodevfrom
ls_224_add_table_text_wrap_toggle
Feb 2, 2026
Merged

Add table text wrap toggle#252
jthompson-arcus merged 32 commits intodevfrom
ls_224_add_table_text_wrap_toggle

Conversation

@LDSamson
Copy link
Copy Markdown
Collaborator

@LDSamson LDSamson commented Dec 9, 2025

Mostly solves #224 .

Provides the use to enable text wrapping. The option is off by default, and a warning is shown that it might be slow to enable it for big tables

grafik

@LDSamson LDSamson marked this pull request as ready for review December 12, 2025 16:12
Copy link
Copy Markdown
Collaborator

@jthompson-arcus jthompson-arcus left a comment

Choose a reason for hiding this comment

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

Enabling text wrap does not appear to be working. For instance checkout subject BEL_04_772 and the Medication tab. There are 15 records. If you "enable text wrap" you can only view 10 of them.

Comment thread R/mod_common_forms.R
Comment thread R/mod_study_forms.R
LDSamson and others added 2 commits December 17, 2025 17:13
Co-authored-by: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com>
Co-authored-by: Jeff Thompson <160783290+jthompson-arcus@users.noreply.github.com>
@jthompson-arcus
Copy link
Copy Markdown
Collaborator

I think generally I'm a bit confused by this PR. In the common events the text wrapping is disabled on form level review. I assume this is to mitigate issues from having all records visible but the similar checking doesn't seem to be in place for the toggle to see all subjects. The toggle doesn't disappear at the form level either so it all feels a bit messy to me.

@LDSamson
Copy link
Copy Markdown
Collaborator Author

I think generally I'm a bit confused by this PR. In the common events the text wrapping is disabled on form level review. I assume this is to mitigate issues from having all records visible but the similar checking doesn't seem to be in place for the toggle to see all subjects. The toggle doesn't disappear at the form level either so it all feels a bit messy to me.

Hi, thanks for the review. Initially, the idea was to discourage to use it in form level review, but not to disallow it. Do you think it should be completely forbidden?

@jthompson-arcus
Copy link
Copy Markdown
Collaborator

I think generally I'm a bit confused by this PR. In the common events the text wrapping is disabled on form level review. I assume this is to mitigate issues from having all records visible but the similar checking doesn't seem to be in place for the toggle to see all subjects. The toggle doesn't disappear at the form level either so it all feels a bit messy to me.

Hi, thanks for the review. Initially, the idea was to discourage to use it in form level review, but not to disallow it. Do you think it should be completely forbidden?

If this feature is something desired, I personally would think about turning pagination back on if it is triggered. You are re-rendering the table anyways.

@LDSamson
Copy link
Copy Markdown
Collaborator Author

Enabling text wrap does not appear to be working. For instance checkout subject BEL_04_772 and the Medication tab. There are 15 records. If you "enable text wrap" you can only view 10 of them.

@jthompson-arcus Text wrap works it's just that not all entries are shown indeed which I did not expect.. do you know why this is the case?

I will try to switch to pagination again and see if that works.

# Conflicts:
#	tests/testthat/_snaps/app_feature_01/app-feature-1-003_.png
#	tests/testthat/_snaps/app_feature_03/app-feature-3-001.json
#	tests/testthat/_snaps/app_feature_03/app-feature-3-002.json
@LDSamson LDSamson marked this pull request as draft December 23, 2025 11:03
@LDSamson LDSamson removed the request for review from jthompson-arcus December 23, 2025 11:03
@LDSamson LDSamson assigned LDSamson and unassigned jthompson-arcus Dec 23, 2025
# Conflicts:
#	DESCRIPTION
#	NEWS.md
#	R/mod_review_form_tbl.R
#	R/mod_study_forms.R
#	inst/golem-config.yml
#	tests/testthat/test-app_feature_03.R
@LDSamson LDSamson marked this pull request as ready for review January 5, 2026 17:08
@LDSamson LDSamson assigned jthompson-arcus and unassigned LDSamson Jan 5, 2026
@LDSamson LDSamson added this to the v0.4.0 milestone Jan 9, 2026
Copy link
Copy Markdown
Collaborator

@jthompson-arcus jthompson-arcus left a comment

Choose a reason for hiding this comment

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

I still do not understand why we would not want the end user to be able to enable wrapping when reviewing by form. The word wrap causes the table to display paginated, so we should allow that view for form level reviews as well.

Also, perhaps padding between the AE tables should be considered.

@LDSamson
Copy link
Copy Markdown
Collaborator Author

LDSamson commented Jan 12, 2026

Text wrap is now consistent between form-level review and just pressing the show all participants button. It can be used with both.

It switches to no text wrapping when clicking on 'show all participants'. This is because in this mode, it is probably easier to compare lots of data if the data is on one row. But you can still switch on text wrap if desired.

I also added extra padding under the SAE table as suggested and removed the tooltip warning since it seems like text wrap is still okay for large datasets when pagination is enabled (which is the case here)

Copy link
Copy Markdown
Collaborator

@jthompson-arcus jthompson-arcus left a comment

Choose a reason for hiding this comment

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

I know this is turning into the PR of a thousand change requests but...I found a bug.

If you select rows to review and then toggle "enable text wrapping", the rows will still be cached and you can hit the "save" button but the rows in the table do not show being selected.

@LDSamson LDSamson marked this pull request as draft January 30, 2026 11:58
@LDSamson
Copy link
Copy Markdown
Collaborator Author

I know this is turning into the PR of a thousand change requests but...I found a bug.

If you select rows to review and then toggle "enable text wrapping", the rows will still be cached and you can hit the "save" button but the rows in the table do not show being selected.

@jthompson-arcus thanks for spotting this. Now resolved in this commit: 2c0a2e1.
I also added a test to ensure that it is resolved: 2c0a2e1

Comment thread R/mod_review_form_tbl.R
Comment on lines -152 to +159
# Any time the data in the form table is updated, "show all" is toggled,
# or the subject being viewed is changed, the server data for the datatable
# needs to be updated
# Triggers when server data needs to be updated. Also triggers for each
# change in pending review records (e.g. a checkbox in column `Reviewed`
# is toggled on or off).
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@jthompson-arcus changed the description here and in lines 173-174 a bit to capture the 'why' because it always take me some time to familiarize with the logic here after a while. If you don't like it or have suggestions for better description please let me know.

@LDSamson LDSamson marked this pull request as ready for review January 30, 2026 14:32
Copy link
Copy Markdown
Collaborator

@jthompson-arcus jthompson-arcus left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Thanks for the updates.

@jthompson-arcus jthompson-arcus merged commit baeb28a into dev Feb 2, 2026
5 checks passed
@jthompson-arcus jthompson-arcus deleted the ls_224_add_table_text_wrap_toggle branch February 2, 2026 15:22
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.

2 participants