Skip to content

limit testimony committee length #1801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mertbagt
Copy link
Collaborator

@mertbagt mertbagt commented Apr 22, 2025

Summary

image

Checklist

  • [n/a] On the frontend, I've made my strings translate-able.
  • [n/a ] If I've added shared components, I've added a storybook story.
  • I've made pages responsive and look good on mobile.

Screenshots

Add some screenshots highlighting your changes.

Known issues

none at present

Steps to test/reproduce

For each feature or bug fix, create a step by step list for how a reviewer can test it out. E.g.:

  1. go to Browse Testimony
  2. be in a mobile viewport
  3. make sure no committee name exceeds 35 characters

Copy link

vercel bot commented Apr 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
maple-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 23, 2025 1:09am

@Mephistic
Copy link
Collaborator

I'll let a designer speak to the minimum viewport (though I'd guess it's Bootstrap's sm or xs), but as for the committee data:

  • There is a fixed list of committees that we scrape daily and keep in Firestore
  • There are currently 61 committees in General Court 194
  • This includes House committees, Senate committees, Joint committees, and Temporary committees
  • A committee will have the following relevant fields:
    • Branch (e.g. House of Representatives)
    • FullName (e.g. House Committee on Rules)
    • ShortName (e.g. Rules (H))
    • CommitteeCode (e.g. H33) (Probably only relevant to API users)

Here are the short names for the committees in 194:

[
  'Rules (H)',
  'Ways and Means (H)',
  'Bills in the Third Reading (H)',
  'Ethics (H)',
  'Human Resources and Employee Engagement(H)',
  'Post Audit and Oversight (H)',
  'Climate Action and Sustainability (H)',
  'Steering, Policy and Scheduling (H)',
  'Operations, Facilities and Security(H)',
  'Federal Funding, Policy and Accountability (H)',
  'Intergovernmental Affairs',
  'Municipalities and Regional Government (J)',
  'Financial Services (J)',
  'Economic Development and Emerging Technologies (J)',
  'Children, Families and Persons with Disabilities (J)',
  'Education (J)',
  'Election Laws (J)',
  'Public Health (J)',
  'Consumer Protection and Professional Licensure (J)',
  'Mental Health, Substance Use and Recovery (J)',
  'Judiciary (J)',
  'Environment and Natural Resources (J)',
  'Public Safety and Homeland Security (J)',
  'Public Service (J)',
  'Health Care Financing (J)',
  'State Administration and Regulatory Oversight (J)',
  'Revenue (J)',
  'Transportation (J)',
  'Housing (J)',
  'Higher Education (J)',
  'Tourism, Arts and Cultural Development (J)',
  'Veterans and Federal Affairs (J)',
  'Bonding, Capital Expenditures and State Assets',
  'Ad Info Tech/Cybersecurity',
  'Racial Equity, Civil Rights, and Inclusion',
  'Telecommunications, Utilities and Energy (J)',
  'Agriculture',
  'Ways and Means (J)',
  'Rules (J)',
  'Labor and Workforce Development (J)',
  'Elder Affairs (J)',
  'Community Development and Small Businesses (J)',
  'Cannabis Policy (J)',
  'Emergency Preparedness and Management',
  'Rules (S)',
  'Ways and Means (S)',
  'Bills in the Third Reading (S)',
  'Post Audit and Oversight (S)',
  'Steering and Policy (S)',
  'Climate Change and Global Warming (S)',
  'Personnel and Administration (S)',
  'Intergovernmental Affairs (S)',
  'Ethics (S)',
  'Census (S)',
  'Juvenile and Emerging Adult Justice (S)',
  'Temp Rules',
  'Temporary Ways and Means',
  'Subcommittee on Rules',
  'Temporary Rules (TS)',
  'Temporary Ways and Means',
  'Temporary Bills in the Third Reading'
]

@mertbagt
Copy link
Collaborator Author

mertbagt commented Apr 23, 2025

components\search\testimony\TestimonyHit.tsx

the Testimony component gets its committee data from bill?.currentCommittee which in turn has the following types:

image

if I can get an object with the committee list data, I can compare bill.currentCommittee.name against that list and write some code that will

display the short name (or possibly a truncated short name as some as still kinda long)

and

hide the long name, but when the user taps the screen it can be displayed as a tool tip or something along those lines

@mertbagt
Copy link
Collaborator Author

forget my prior comments

Matt. V wants to just stick with the 35 char limit with elipses for now

Copy link
Collaborator

@Mephistic Mephistic left a comment

Choose a reason for hiding this comment

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

Looks fine to me, just the one nit.

@@ -44,6 +46,14 @@ const TestimonyResult = ({ hit }: { hit: Hit<Testimony> }) => {
const { user } = useAuth()
const { followOrg } = useFlags()
const isCurrentUser = user?.uid === hit.authorUid
const isMobile = useMediaQuery("(max-width: 768px)")

function limitStringLength35Char(str: string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: We added a utility function in formatting.tsx for this a while back - we may want to standardize on that going forward:

export const truncateText = (s: string | undefined, maxLength: number) =>

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