Skip to content

feat(Activity): Add Title field - #2332

Open
ashrrais wants to merge 15 commits into
developfrom
asher/activity-title-header
Open

feat(Activity): Add Title field#2332
ashrrais wants to merge 15 commits into
developfrom
asher/activity-title-header

Conversation

@ashrrais

@ashrrais ashrrais commented Aug 5, 2026

Copy link
Copy Markdown

Changes

-Added an "Activity Title" field that is consistent across all component types which is threaded through the schema via ComponentComponent.title, the authoring dialog, and the student-facing display via component-header. Important to note this is not the SLE, but simply the student view for a teacher working in the authoring tool.

-The field is now a standalone angular component named EditComponentHeaderComponent which owns its own save methods instead of living inline in the edit dialog.

-The Activity Title on new components defaults to the name of the component for all components. We discussed changing this for activity types like "custom," but those decisions and changes are yet to be implemented.

-Fixed what I believe to be a pre-existing bug where the prompt on many activity types, such as the two comment-based activity types and label/graph/custom, where the prompt field wouldn't render until some other field was touched, forcing an update. This was changed by changing component.component.prompt into a getter.

-The open response changes from three weeks ago still exist but these are purely visual changes, and I am happy to remove them. These include the outline, the drop shadow on the box, the drop shadow on the buttons, and the interactivity with the text box.

Test

-Create a new component of any type and ensure the Activity Title prefills with the type name.

-Edit the Activity Title field and ensure that the changes update immediately both in the authoring tool and on the student preview.

-Check that the prompt renders immediately instead of needing an explicit update (without changing any other field).

-There is a merge conflict as develop has been changed while I've been working. Lmk if you want me to handle this locally.

Closes #

@hirokiterashima hirokiterashima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The functionality to specify a title for activities seems to work. 👍 @breity- can you look into styling?

I think that this PR should be just about the activity title. Right now, this PR also adds a border around the OR activity and the background color chooser. These are nice additions, but I think we should handle them in a separate PR, to limit the scope of review.

Can you try to merge the conflicts with the develop branch? If you need help, let us know.

Also, I added some minor comments/suggestions inline to this PR.

});
this.applicationRef.attachView(this.componentRef.hostView);
setTimeout(() => hostElement.focus());
setTimeout(() => hostElement.focus({ preventScroll: true }));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Was scrolling to focused element preventing an issue before?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

When changing the attributes for an element in the authoring tool, the page would begin at the prompt entry, meaning you had to scroll up before seeing the entry for the activity title. This behavior is certainly not an old flaw in the code, but this was a fix that worked for me when it appeared.

styleUrl: 'html-student.component.scss',
templateUrl: 'html-student.component.html'
templateUrl: 'html-student.component.html',
imports: [ComponentHeaderComponent]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

alphabetize: move to top.

selector: 'outside-url-student',
templateUrl: 'outside-url-student.component.html'
templateUrl: 'outside-url-student.component.html',
imports: [ComponentHeaderComponent]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

alphabetize: move to top.

Comment on lines +1 to +4
<div
class="pt-4 px-6 pb-6 rounded-lg border-2 border-black"
[style.background-color]="componentContent.backgroundColor ? (componentContent.backgroundColor.startsWith('#') ? componentContent.backgroundColor : '#' + componentContent.backgroundColor) : 'transparent'"
>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This new outer div would cause a indentation of the entire contents of this file. @breity is this the best way to do this, or is there another way to achieve the same outcome?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be removed from the PR anyways, as we'll address design changes to components in another PR.

Comment on lines +13 to +16
componentChanged(): void {
this.projectService.nodeChanged();
this.projectService.saveProject();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this necessary? AbstractComponentAuthoring.componentChanged already calls this.projectService.nodeChanged(), which in turn saves the project.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a fragment from the saving issue for tiles in the authoring tool that we discussed last week, and that Jon said he wanted to look into. These changes will be removed completely with the removal of the OR style changes regardless.

@hirokiterashima hirokiterashima changed the title Asher Add Activity Title field to all component types feat(Activity): Add Title field Aug 6, 2026
@qltysh

qltysh Bot commented Aug 12, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (6)

RatingFile% DiffUncovered Line #s
New Coverage rating: B
...omponents/summary/summary-student/summary-student.component.ts100.0%
New Coverage rating: F
...onents/embedded/embedded-student/embedded-student.component.ts100.0%
New Coverage rating: B
src/assets/wise5/services/createComponentService.ts100.0%
New Coverage rating: A
src/app/possible-score/possible-score.component.ts100.0%
New Coverage rating: A
...ise5/directives/component-header/component-header.component.ts100.0%
New Coverage rating: C
...ponents/edit-component-title/edit-component-title.component.ts72.7%14-18
Total83.3%
🤖 Increase coverage with AI coding...
In the `asher/activity-title-header` branch, add test coverage for this new code:

- `src/assets/wise5/authoringTool/components/edit-component-title/edit-component-title.component.ts` -- Line 14-18

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@breity breity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I updated some styles and added a check to only show the title element if it is set. I also removed support for HTML in the title, since titles should generally just be strings and then we don't have to add the sanitizer dependency.

I'm wondering if we should set the title by default when a new component is created or if we should leave it blank. I like the idea of each activity having a title, but I wonder if it will be annoying/frustrating for authors editing existing units that don't use activity titles. Something we can discuss more as we work on the VLE redesign.

@breity breity added the enhancement New feature of any size or improvement (UI, performance, security) label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants